note 30293 added to function.str-word-count
| From: | fie at myrealbox dot com | Date: | Thu, 13 Mar 2003 10:24:53 +0000 |
| Subject: | note 30293 added to function.str-word-count | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-45204@lists.php.net to get a copy of this message | ||
i dunno why you guys keep using preg
maybe there is something i'm missing
it might help if i understood how to use
preg as to what you are accualy doing
nevertheless here's a short function
doing what i guess is the exact same
thing that you guys are doing but
i think mine is shorter and prolly runs
faster since it's not using patterns
function wrdcnt($haystack) {
$cnt = explode(" ", $haystack);
return count($cnt) - 1;
}
--
http://www.php.net/manual/en/function.str-word-count.php
http://master.php.net/manage/user-notes.php?action=edit+30293
http://master.php.net/manage/user-notes.php?action=delete+30293
http://master.php.net/manage/user-notes.php?action=reject+30293