| str_word_count() | ใช้นับจำนวนคำ |
|---|
function:str_word_count ( string, format );
return type:int, array
content:กรณีที่ไม่กำหนดค่าของ format จะใช้นับจำนวนคำ กรณีที่กำหนดค่าของ format จะเก็บ คำแต่ละคำ ไว้ใน array แล้วคืนค่ามาให้
example:echo str_word_count ( "bamboo lab code" ); print_r ( str_word_count ( "bamboo lab code", 1 ) );
comment:ถ้า format = 1 จะคืนค่า array ที่มี key เริ่มจาก 0 เรียงมาเรืื่อยๆ ถ้า format = 2 จะคืนค่า array ที่มี key คือ ตำแหน่งเริ่มต้นของคำนั้นๆ