note 68011 deleted from function.array-walk by philip
| From: | philip@php.net | Date: | Tue, 11 Jul 2006 06:36:44 +0000 |
| Subject: | note 68011 deleted from function.array-walk by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-114657@lists.php.net to get a copy of this message | ||
Note Submitter: legolas558 dot sourceforge comma net
----
I find sometimes useful scanning an array for a matching condition with this function
<?php
function array_walk_cond($arr, $funcname, $match) {
$c=count($arr);
for($i=0;$i<$c;$i++) {
if ($funcname($arr[$i], $match))
return true;
}
return false;
}
?>