There! The str_word_count() function does the trick.
str_word_count()
Might it be that count() only works with arrays?
count()