<?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>KengCom.com &#187; หัดเขียน PHP</title>
	<atom:link href="http://www.kengcom.com/category/%e0%b8%ab%e0%b8%b1%e0%b8%94%e0%b9%80%e0%b8%82%e0%b8%b5%e0%b8%a2%e0%b8%99-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kengcom.com</link>
	<description>ทุกเรื่องคอมพิวเตอร์ และ เทคโนโลยี ที่คุณอยากรู้</description>
	<lastBuildDate>Mon, 08 Aug 2011 03:25:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>เขียน PHP ให้นับจำนวนคำในสตริง (String)</title>
		<link>http://www.kengcom.com/%e0%b9%80%e0%b8%82%e0%b8%b5%e0%b8%a2%e0%b8%99-php-%e0%b9%83%e0%b8%ab%e0%b9%89%e0%b8%99%e0%b8%b1%e0%b8%9a%e0%b8%88%e0%b8%b3%e0%b8%99%e0%b8%a7%e0%b8%99%e0%b8%84%e0%b8%b3%e0%b9%83%e0%b8%99%e0%b8%aa/</link>
		<comments>http://www.kengcom.com/%e0%b9%80%e0%b8%82%e0%b8%b5%e0%b8%a2%e0%b8%99-php-%e0%b9%83%e0%b8%ab%e0%b9%89%e0%b8%99%e0%b8%b1%e0%b8%9a%e0%b8%88%e0%b8%b3%e0%b8%99%e0%b8%a7%e0%b8%99%e0%b8%84%e0%b8%b3%e0%b9%83%e0%b8%99%e0%b8%aa/#comments</comments>
		<pubDate>Sat, 11 Oct 2008 01:58:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[หัดเขียน PHP]]></category>
		<category><![CDATA[string word count]]></category>
		<category><![CDATA[word count]]></category>
		<category><![CDATA[นับจำนวนคำใน string]]></category>
		<category><![CDATA[สตริง]]></category>
		<category><![CDATA[หัดเขียนโปรแกรม]]></category>

		<guid isPermaLink="false">http://www.kengcom.com/?p=196</guid>
		<description><![CDATA[วันนี้มาเรียนรู้การเขียนโปรแกรม PHP ให้มันนับจำนวนคำกันครับ หรือที่เราเรียกกันเป็น ภาษาอังกฤษว่า Word Count นั่นเอง โปรแกรม PHP ที่เรากำลังจะเขียนต่อไปนี้ จะนำไปใช้กับ ภาษาอังกฤษเท่านั้นนะครับ สังเกตว่าภาษาอังกฤษจะแยกคำด้วย เครื่องหมายเว้นวรรค หรือถ้ามองเป็น string ก็คือ &#8221; &#8221; หรืออาจจะแบ่งคำด้วยอย่างอื่นด้วย เช่น เครื่องหมาย คอมม่า(comma) และมองเป็นสตริง จะมองได้เป็น &#8220;,&#8221; วันนี้เอาแบบง่ายๆ ไม่ซับซ้อนไปก่อนครับ คือ นับจำนวนคำโดยใช้สตริง &#8221; &#8221; ในการแยกคำ สามารถนำ function ด้านล่างนี้ ไปใช้นับจำนวนคำใน string ได้เลยครับ 
function count_words($str) {
&#160;&#160;&#160;&#160; $no = count(explode(" ",$str));
&#160;&#160;&#160;&#160; return $no;
 }

อธิบายโปรแกรม :
- แยกคำในสตริงด้วยเครื่องหมาย &#8221; &#8221; โดยใช้ [...]]]></description>
		<wfw:commentRss>http://www.kengcom.com/%e0%b9%80%e0%b8%82%e0%b8%b5%e0%b8%a2%e0%b8%99-php-%e0%b9%83%e0%b8%ab%e0%b9%89%e0%b8%99%e0%b8%b1%e0%b8%9a%e0%b8%88%e0%b8%b3%e0%b8%99%e0%b8%a7%e0%b8%99%e0%b8%84%e0%b8%b3%e0%b9%83%e0%b8%99%e0%b8%aa/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>เขียน PHP ให้ random เลข แบบไม่ซ้ำ</title>
		<link>http://www.kengcom.com/random-number-php-function/</link>
		<comments>http://www.kengcom.com/random-number-php-function/#comments</comments>
		<pubDate>Tue, 07 Oct 2008 17:59:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[หัดเขียน PHP]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[random link]]></category>
		<category><![CDATA[ฟังก์ชั่น]]></category>
		<category><![CDATA[วัตถุ]]></category>
		<category><![CDATA[เรียน php]]></category>
		<category><![CDATA[แรนดอม]]></category>

		<guid isPermaLink="false">http://www.kengcom.com/?p=139</guid>
		<description><![CDATA[อันนี้เป็น code Php เขียน function ในรูปแบบเชิงวัตถุ (Object) นะครับ เวลาใช้งานก็ให้สร้าง object ใหม่ขึ้นมาแล้วเรียกใช้ฟังก์ชั่น (function) ภายใน object นั้น (ไม่รู้ผมพูดถูกป่าว) เอาเป็นว่าดูตัวอย่างแล้วเอาไปประยุกต์ใช้ดีกว่าครับ

ฟังก์ชั่นในรูปแบบ class
class GetRandomNum {
private $sta;
private $nend;
private $numb;
private $nu_test;
private $used;
private $i;
function __construct($a,$b,$c){
$this-&#62;sta = $a;
$this-&#62;nend = $b;
$this-&#62;numb = $c;
}
function operate(){
if(($this-&#62;nend - $this-&#62;sta) &#62;= $this-&#62;numb -1){
$this-&#62;used = array();
for    ($this-&#62;i=0; $this-&#62;i &#60; $this-&#62;numb; $this-&#62;i++){
$this-&#62;nu_test = mt_rand($this-&#62;sta,$this-&#62;nend);
while(in_array($this-&#62;nu_test,$this-&#62;used)){
$this-&#62;nu_test = mt_rand($this-&#62;sta,$this-&#62;nend);
}
$this-&#62;used[] = $this-&#62;nu_test;
}
return [...]]]></description>
		<wfw:commentRss>http://www.kengcom.com/random-number-php-function/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>เริ่มเขียน PHP โปรแกรมแรก Hello World</title>
		<link>http://www.kengcom.com/basic-php-with-hello-world-program/</link>
		<comments>http://www.kengcom.com/basic-php-with-hello-world-program/#comments</comments>
		<pubDate>Tue, 07 Oct 2008 07:36:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[หัดเขียน PHP]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[พีเอชพี]]></category>
		<category><![CDATA[สอน php]]></category>
		<category><![CDATA[หัดเขียนโปรแกรม]]></category>
		<category><![CDATA[เขียนโปรแกรม]]></category>
		<category><![CDATA[เรียน php]]></category>

		<guid isPermaLink="false">http://www.kengcom.com/?p=99</guid>
		<description><![CDATA[ก่อนอื่น เรามาทำความรู้จักกับ PHP ก่อนดีกว่าครับ เผื่อใครยังไม่รู้ PHP ย่อมาจาก Hypertext Preprocessor เป็นภาษาโปรแกรมที่ทำงานฝั่งเซิร์ฟเวอร์ (Server-Side Language) จะแตกต่างจาก HTML ที่เอาไว้เป็นตัวอธิบายหน้าเอกสารทางฝั่ง client หรือฝั่งผู้ใช้โดยใช้บราวเซอร์ (Browser) เป็นตัวประมวลผลออกมา เราสามารถเขียน PHP code ออกมาเพื่อควบคุม HTML อีกที โดย PHP จะเป็นตัวบังคับการแสดง HTML TAG ให้แสดงบน browser ผู้ใช้ (client) รวมทั้งสามารถทำงานร่วมกับผู้ใช้ ในกรณีที่มีการส่งผ่านค่า หรือ ข้อมูลผู้ใช้ มายัง server เพื่อให้ server ประมวลผล จะเห็นว่า การพัฒนาเวบไซต์ (website) ด้วย PHP จะมีความยืดหยุ่นมากกว่า การเขียน HTML TAG Code ธรรมดาครับ เพราะสามารถทำหน้าเวบเพจ [...]]]></description>
		<wfw:commentRss>http://www.kengcom.com/basic-php-with-hello-world-program/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

