note 83624 added to function.array-walk-recursive
| From: | amoffat at amoffat dot com | Date: | Thu, 05 Jun 2008 00:15:40 +0000 |
| Subject: | note 83624 added to function.array-walk-recursive | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-140132@lists.php.net to get a copy of this message | ||
<?
function my_array_map() {
$args = func_get_args();
$arr = array_shift($args);
foreach ($args as $fn) {
$nfn = create_function('&$v, $k, $fn', '$v = $fn($v);');
array_walk_recursive($arr, $nfn, $fn);
}
return $arr;
}
?>
takes an array as the first argument, and functions as the other arguments. it applies those
functions recursively to the array
----
Server IP: 208.69.120.35
Probable Submitter: 66.167.70.6
----
Manual Page -- http://www.php.net/manual/en/function.array-walk-recursive.php
Edit -- https://master.php.net/note/edit/83624
Del: integrated -- https://master.php.net/note/delete/83624/integrated
Del: useless -- https://master.php.net/note/delete/83624/useless
Del: bad code -- https://master.php.net/note/delete/83624/bad+code
Del: spam -- https://master.php.net/note/delete/83624/spam
Del: non-english -- https://master.php.net/note/delete/83624/non-english
Del: in docs -- https://master.php.net/note/delete/83624/in+docs
Del: other reasons-- https://master.php.net/note/delete/83624
Reject -- https://master.php.net/note/reject/83624
Search -- https://master.php.net/manage/user-notes.php