str_word_count
How can I get this to count numbers too? Or is there something else I can use to count the words and numbers in a string...preferably without breaking it all up.
str_word_count
How can I get this to count numbers too? Or is there something else I can use to count the words and numbers in a string...preferably without breaking it all up.
So weird that it doesn't count numbers!
If your input is really well formed (with only single spaces between words) you could use sizeof(explode(" ", $str));
yea, I ended up going with $count = count(explode(" ", $data));