note 39146 added to function.array-map
| From: | Vincent at rn2 dot php dot net | Date: | Sun, 18 Jan 2004 20:10:43 +0000 |
| Subject: | note 39146 added to function.array-map | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-63802@lists.php.net to get a copy of this message | ||
This function, which works like array_map(), but accepts one callback and one array:
<?php
function array_func($func,$array) {
if ( (!function_exists($func)) or (!is_array($array)) )
return false;
reset($array);
$ret = array()
while (list($key,$value) = each($array))
$ret[$key] = $func($value);
return $ret;
}
?>
----
Manual Page -- http://www.php.net/manual/en/function.array-map.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+39146
Delete -- http://master.php.net/manage/user-notes.php?action=delete+39146&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+39146&report=yes
Search -- http://master.php.net/manage/user-notes.php