hey, ok i want to count the words in a given string i figure i do this by using the explode() function but how do i ocunt how many words there would be....($msg2=explode($msg," "); kinda thing...all help is appreciated...
Just count the number of elements in the array:
$num_words = count(explode($msg, " "));
There could be errors, though, but generally it should work.
Diego
if you want to use explode(), then try:
$msgwordcount=count(explode(" ",$msg));
Biggus