note 8944 deleted from ref.strings by sander
| From: | sander@php.net | Date: | Sun, 07 Apr 2002 13:37:28 +0000 |
| Subject: | note 8944 deleted from ref.strings by sander | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-28918@lists.php.net to get a copy of this message | ||
count a number of specific characteres in string. use str_count("a", "asda");
function str_count ($arg, $chr) {
for ($x=0; $x <= strlen($arg); $x++) {
if (substr($arg, $x, 1) == $chr) { $count++; }
}
return $count;
}