note 66486 deleted from function.preg-grep by didou
| From: | didou@php.net | Date: | Fri, 02 Feb 2007 20:41:38 +0000 |
| Subject: | note 66486 deleted from function.preg-grep by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-122580@lists.php.net to get a copy of this message | ||
Note Submitter: tobyf at web dot de
----
For older PHP versions (> 4.2.0) you can use this function:
<?php
function c_preg_grep($pattern,&$array,$flag=false)
{
if ($flag != PREG_GREP_INVERT)
{
return preg_grep($pattern,$array);
}
else
{
$remove = preg_grep($pattern,$array);
return array_diff($array,$remove);
}
}
?>