Menu
Hi quick question on str_word_count:
I need to work out the amount of words in a string but can’t seem to work it out. I’m using $var = str_word_count($string, 0); which should give an output like:
[0] => The
[1] => Cat
[2] => Sat
[3] => On
[4] => The
[5] => Mat
but how can i get it to return the number 5? I’m guessing the answer lies in key() and end()….
i’m sure this is really simple but i can’t quite work it out.
cheers,
Durbs