[[แจกก!!!]] สคริปต์ PHP ตัดอักษรอักขระพิเศษออก

เริ่มโดย artwhale, 30 พฤษภาคม 2011, 20:03:34

หัวข้อก่อนหน้า - หัวข้อถัดไป

0 สมาชิก และ 1 ผู้มาเยือน กำลังดูหัวข้อนี้

artwhale

ตัดอักษรอักขระพิเศษออก ? . / , { } ] [ / * - + อื่นๆ (ใช้ได้กับภาษาอังกฤษเท่านั้น)

ดาวน์โหลด: http://www.upload-thai.com/download.php?id=9b81b2583b40d4a7424a345e301a9520


Ex.

? . / , { } ] [ / * - + abc



จะได้

abc



สคริปต์อื่นๆ
[[แจกก!!!]] สคริปต์ PHP ลบบรรทัดว่างออก

buypai

อยากใช้ตัวนี้จัง แต่มันไม่สมบูรณ์ใช้ไม่ได้ แก้ไม่เป็น มีใครมีบ้างจ๊ะ อยากได้ๆ  :wanwan017:
[direct=http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=hostguaff-hostcheap][/direct]

Hostgator
ลด 25% ใส่โค้ด ใส่โค้ด cheappong25off นี้นะจ้ะ ตัวเธอ
ลด $9.94 ใส่โค้ด cheappong555

xmen256k

อ้างถึงจาก: buypai ใน 12 มิถุนายน 2011, 23:56:23
อยากใช้ตัวนี้จัง แต่มันไม่สมบูรณ์ใช้ไม่ได้ แก้ไม่เป็น มีใครมีบ้างจ๊ะ อยากได้ๆ  :wanwan017:


<?php
function slug($str){
//$str = strtolower(trim($str));
$str preg_replace('/[^A-Za-z0-9-]/''-'$str);
$str preg_replace('/-+/'" "$str);
return $str;
}
//example
$text='Company :AAA soft" "Year : 1980';
echo 
slug($text);

?>


xvlnw.com

อ้างถึง$txt = 'message';
$txt = strtolower(str_replace(" ","-",$txt));
$txt = strtolower(preg_replace('~[^a-z0-9ก-๙\.\-\_]~iu','',$txt));
echo $txt;

ลองดูครับผม
[direct=https://cloudhost.in.th/wordpress-hosting]ツ ⓌⓄⓇⒹⓅⓇⒺⓈⓈ ⒽⓄⓈⓉⒾⓃⒼ [/direct] :wanwan014:  :D
[direct=https://cloudhost.in.th/cloudhosting.html]Cloud Hosting[/direct] [direct=https://cloudhost.in.th/cloudvps.html]Cloud Server[/direct] [direct=https://cloudhost.in.th/vpshosting.html]Cloud VPS Hosting[/direct] [direct=https://cloudhost.in.th/windowsvps.html]Cloud Windows[/direct] Tel: 080-348-0843 LINE: ixvlnw

buypai

กดแทง ให้แล้ว ขอบคุณทั้งสองท่านครับ
[direct=http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=hostguaff-hostcheap][/direct]

Hostgator
ลด 25% ใส่โค้ด ใส่โค้ด cheappong25off นี้นะจ้ะ ตัวเธอ
ลด $9.94 ใส่โค้ด cheappong555