note 99344 deleted from function.array-map by danbrown
| From: | danbrown@php.net | Date: | Thu, 12 Aug 2010 00:51:40 +0000 |
| Subject: | note 99344 deleted from function.array-map by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-171591@lists.php.net to get a copy of this message | ||
Note Submitter: James Ferguson
----
This is my array_map_r implementation:
<?
function array_map_r($func, $arr)
{
return is_array($arr) ? array_map('array_map_r', array_fill(0, count($arr), $func),
$arr) : call_user_func($func, $arr);
}
?>
It assumes $func only takes one argument, but it's nice and simple.