|
Free
PHP Tutorials
|
![]() |
home |
Stay
at Home and Learn
|
|||||
str_word_count( ) |
||||||
|
Tells you how many words a string has. The syntax is this: str_word_count(string, return ,char) If all you want to know is how many words a string has, then you can leave out "return", and "char". In which case, you can use it like this: $num_of_words = str_word_count("The word count function"); print $num_of_words; The return value can be one of three numbers: 0 - How many words found. This is the default The char option is if you want the function to consider any additional words to count.
|