We can also count the number of words in a string with a built-in function.
There! The str_word_count() function does the trick.
str_word_count()
Might it be that count() only works with arrays?
count()