<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>PHP แบนคำหยาบ - TsupamaN.com</title>
	<atom:link href="https://www.tsupaman.com/tag/php-%E0%B9%81%E0%B8%9A%E0%B8%99%E0%B8%84%E0%B8%B3%E0%B8%AB%E0%B8%A2%E0%B8%B2%E0%B8%9A/feed" rel="self" type="application/rss+xml" />
	<link>https://www.tsupaman.com/tag/php-แบนคำหยาบ</link>
	<description>ทำเว็บไซต์ด้วย Wordpress</description>
	<lastBuildDate>Tue, 14 Jan 2014 09:05:04 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.1</generator>
	<item>
		<title>PHP Function: แบนคำหยาบ</title>
		<link>https://www.tsupaman.com/2014/02/php-function-%e0%b9%81%e0%b8%9a%e0%b8%99%e0%b8%84%e0%b8%b3%e0%b8%ab%e0%b8%a2%e0%b8%b2%e0%b8%9a</link>
		
		<dc:creator><![CDATA[TsupamaN]]></dc:creator>
		<pubDate>Wed, 19 Feb 2014 09:22:15 +0000</pubDate>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[PHP กรองคำหยาบ]]></category>
		<category><![CDATA[PHP แบนคำหยาบ]]></category>
		<guid isPermaLink="false">https://www.tsupaman.com/?p=580</guid>

					<description><![CDATA[<p>วันนี้มาดูโค้ด PHP ในส่วนของฟังก์ชั่น การกรองคำหยาบออกจากเว็บไซต์กันครับ แบบง่ายๆ เอาไปใช้กัน และสามารถเอาไปต่อยอดได้ด้วยครับ มาเริ่มกันเลย &#60;? # Function: แบนคำหยาบ (จะใช้ในแสดงข้อมูล) function check_ban_rude($message = "") { # Set word: กำหนดคำที่ต้องการ $wordban = array( "ashole", "a s h o l e", "a.s.h.o.l.e", "f u c k", "d i c k", "f.u.c.k", "มึง", "มึ ง", "ดอกทอง" ); # Change word: สัญลักษณ์เมื่อคำๆนั้นถูกแบน $banchange = "&#60;font color=red&#62;***&#60;/font&#62;"; [&#8230;]</p>
<p>The post <a href="https://www.tsupaman.com/2014/02/php-function-%e0%b9%81%e0%b8%9a%e0%b8%99%e0%b8%84%e0%b8%b3%e0%b8%ab%e0%b8%a2%e0%b8%b2%e0%b8%9a">PHP Function: แบนคำหยาบ</a> appeared first on <a href="https://www.tsupaman.com">TsupamaN.com</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>วันนี้มาดูโค้ด PHP ในส่วนของฟังก์ชั่น การกรองคำหยาบออกจากเว็บไซต์กันครับ แบบง่ายๆ เอาไปใช้กัน และสามารถเอาไปต่อยอดได้ด้วยครับ มาเริ่มกันเลย</p>
<pre class="lang:php decode:true ">&lt;?
# Function: แบนคำหยาบ (จะใช้ในแสดงข้อมูล)
function check_ban_rude($message = "")
{
# Set word: กำหนดคำที่ต้องการ
$wordban = array(
"ashole",
"a s h o l e",
"a.s.h.o.l.e",
"f u c k",
"d i c k",
"f.u.c.k",
"มึง",
"มึ ง",
"ดอกทอง"
);
# Change word: สัญลักษณ์เมื่อคำๆนั้นถูกแบน
$banchange = "&lt;font color=red&gt;***&lt;/font&gt;";
$message = nl2br($message);
# Loop check replace word
for ($i = 0 ; $i &lt; count($wordban); $i++) {
$message = eregi_replace($wordban[$i],$banchange,$message);
} // loop for
return stripslashes($message);
}

//Example
$content = "มึงสิไปไส";
echo check_ban_rude($content);

?&gt;</pre>
<p>เป็นงัยครับ ไม่ยากใช่มั๊ย ขออภัยที่ต้องใช้คำหยาบ คำไม่สุภาพจริงๆนะครับ เป็นแค่ตัวอย่างเฉยๆ</p>
<p>The post <a href="https://www.tsupaman.com/2014/02/php-function-%e0%b9%81%e0%b8%9a%e0%b8%99%e0%b8%84%e0%b8%b3%e0%b8%ab%e0%b8%a2%e0%b8%b2%e0%b8%9a">PHP Function: แบนคำหยาบ</a> appeared first on <a href="https://www.tsupaman.com">TsupamaN.com</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
