note 99344 added to function.array-map
| From: | JamesFerguson at osu1 dot php dot net | Date: | Wed, 11 Aug 2010 23:42:57 +0000 |
| Subject: | note 99344 added to function.array-map | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-171589@lists.php.net to get a copy of this message | ||
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.
----
Server IP: 69.147.83.197
Probable Submitter: 203.217.22.159
----
Manual Page -- http://www.php.net/manual/en/function.array-map.php
Edit -- https://master.php.net/note/edit/99344
Del: integrated -- https://master.php.net/note/delete/99344/integrated
Del: useless -- https://master.php.net/note/delete/99344/useless
Del: bad code -- https://master.php.net/note/delete/99344/bad+code
Del: spam -- https://master.php.net/note/delete/99344/spam
Del: non-english -- https://master.php.net/note/delete/99344/non-english
Del: in docs -- https://master.php.net/note/delete/99344/in+docs
Del: other reasons-- https://master.php.net/note/delete/99344
Reject -- https://master.php.net/note/reject/99344
Search -- https://master.php.net/manage/user-notes.php