Umm, how about:

$string = "hi my name is bob";
$count = (substr_count($string," ")+1);

On Thu, 2003-01-23 at 11:35, Craig wrote:
Is there a way to count the number of words in a string?



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to