ฟังก์ชั่นตัดคำหยาบสามารถเพิ่มคำหยาบได้ ด้วย PHP

ฟังก์ชั่นตัดคำหยาบ

function checkWordBad($word){
$strwordArr = array("f u c k","f.u.c.k","มึง","มึ ง","ม ึ ง","ม ึง","มงึ","มึ.ง","มึ_ง","มึ-ง","มึ+ง","กู","ค ว ย","ค- ว -ย","ค.ว.ย","คอ วอ ยอ","คอ-วอ-ยอ","ปี้","เหี้ย","เหี้-ย","ไอ้***","เฮี้ย","ชาติหมา","ชาดหมา","ช า ด ห ม า","ช.า.ด.ห.ม.า","ช า ติ ห ม า","ช.า.ติ.ห.ม.า","สัดหมา","สัด","หี","สันดาน","ส้นตีน","แตด") ;
$strCensor = "<font color='red'>Censor</font>" ;

foreach ($strwordArr as $value) {
$word = str_replace($value,$strCensor ,$word);
}
return ( $word) ;
}

เพิ่มคำหยาบก็ใส่ไปใน Array ได้เลยนะจ๊ะ
ตย.นี้ไม่ได้ด่าใครนะ ^_^

$word="สวัสดีไอ้เหี้ยทามมายมึงถึงได้ชาติหมาอย่างนี้";
echo checkWordBad($word);

ผลลัพท์
result

You can leave a response, or trackback from your own site. Responses are currently closed, but you can trackback from your own site. You can skip to the end and leave a response. Pinging is currently not allowed. Both comments and pings are currently closed.
Powered by WordPress | Shop Free T-Mobile Phones Online | Thanks to Verizon Phones without Contract, MMORPG Games and Sell Car