note 40493 added to function.preg-match-all
| From: | fabriceb at gmx dot net | Date: | Fri, 05 Mar 2004 11:55:01 +0000 |
| Subject: | note 40493 added to function.preg-match-all | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-66292@lists.php.net to get a copy of this message | ||
If you just want to find out how many times a string contains another simple string, don't use
preg_match_all like I did before I fould the substr_count function.
Use
<?php
$nrMatches = substr_count ('foobarbar', 'bar');
?>
instead. Hope this helps some other people like me who like to think too complicated :-)
----
Manual Page -- http://www.php.net/manual/en/function.preg-match-all.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+40493
Delete -- http://master.php.net/manage/user-notes.php?action=delete+40493&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+40493&report=yes
Search -- http://master.php.net/manage/user-notes.php