note 68011 added to function.array-walk
| From: | legolas558dotsourceforgecommanet at osu1 dot php dot net | Date: | Mon, 10 Jul 2006 11:33:53 +0000 |
| Subject: | note 68011 added to function.array-walk | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-114629@lists.php.net to get a copy of this message | ||
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;
}
?>
----
Server IP: 213.92.11.19
Probable Submitter: 151.44.90.54
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.array-walk.php
Edit -- http://master.php.net/note/edit/68011
Del: integrated -- http://master.php.net/note/delete/68011/integrated
Del: useless -- http://master.php.net/note/delete/68011/useless
Del: bad code -- http://master.php.net/note/delete/68011/bad+code
Del: spam -- http://master.php.net/note/delete/68011/spam
Del: non-english -- http://master.php.net/note/delete/68011/non-english
Del: in docs -- http://master.php.net/note/delete/68011/in+docs
Del: other reasons-- http://master.php.net/note/delete/68011
Reject -- http://master.php.net/note/reject/68011
Search -- http://master.php.net/manage/user-notes.php