[SOLVED] Counting words in a string
Posted: Tue Feb 01, 2005 12:29 pm
I have had a look on Google, and on the PHP.net site but couldnt find what I was looking for.
I need a script that counts how many of a certain words there are in a variable. For instance:
How many times the is said in this phrase: " I went to the seaside, and the sea was out. ". So that would return 2.
Anybody have any ideas?
Thanks
I need a script that counts how many of a certain words there are in a variable. For instance:
How many times the is said in this phrase: " I went to the seaside, and the sea was out. ". So that would return 2.
Anybody have any ideas?
Thanks