note 30293 deleted from function.str-word-count by aidan
| From: | aidan@php.net | Date: | Sat, 26 Jun 2004 06:18:07 +0000 |
| Subject: | note 30293 deleted from function.str-word-count by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-71722@lists.php.net to get a copy of this message | ||
Note Submitter: fie@myrealbox.com
----
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;
}