Voting

: min(one, nine)?
(Example: nine)

The Note You're Voting On

amoffat at amoffat dot com
16 years ago
<?
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

<< Back to user notes page

To Top