note 61345 added to function.preg-match-all
| From: | egingell at sisna dot com | Date: | Wed, 01 Feb 2006 03:31:39 +0000 |
| Subject: | note 61345 added to function.preg-match-all | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-102799@lists.php.net to get a copy of this message | ||
Try this for preg_match_all that takes an array of reg expers.
<?
// Emulates preg_match_all() but takes an array instead of a string.
// Returns an array containing all of the matches.
// The return array is an array containing the arrays normally returned by
// preg_match_all() with the optional third parameter supplied.
function preg_search($ary, $subj) {
$matched = array();
if (is_array($ary)) {
foreach ($ary as $v) {
preg_match_all($v, $subj, $matched[]);
}
} else {
preg_match_all($ary, $subj, $matched[]);
}
return $matched;
}
?>
----
Server IP: 216.194.113.175
Probable Submitter: 65.100.200.115
----
Manual Page -- http://www.php.net/manual/en/function.preg-match-all.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+61345
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+61345&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+61345&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+61345&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+61345&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+61345&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+61345&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+61345&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+61345&report=yes
Search -- http://master.php.net/manage/user-notes.php