note 39485 added to function.preg-grep
| From: | radu_andatnetex dot ro at rn2 dot php dot net | Date: | Fri, 30 Jan 2004 07:56:31 +0000 |
| Subject: | note 39485 added to function.preg-grep | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-64406@lists.php.net to get a copy of this message | ||
It will be helpfull for preg_grep also to catch the strings between pattern paranthesis .
For this I wrote a simple function called preg_grep_all.
Every element of the returned array is an array of preg_match function:
function preg_grep_all($pattern,$array,$reindex=""){
foreach ($array as $key=>$value){
if (preg_match($pattern,$value,$regs)) $tt[$key]=$regs;
}// end foreach
if($reindex) $tt=array_values($tt);
return $tt;
}// end function
----
Manual Page -- http://www.php.net/manual/en/function.preg-grep.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+39485
Delete -- http://master.php.net/manage/user-notes.php?action=delete+39485&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+39485&report=yes
Search -- http://master.php.net/manage/user-notes.php