Skip to content

Instantly share code, notes, and snippets.

@oranj
Created January 3, 2012 19:31
Show Gist options
  • Save oranj/1556494 to your computer and use it in GitHub Desktop.
Save oranj/1556494 to your computer and use it in GitHub Desktop.
Array Map Recursive
function array_map_r($callback, $input) {
$output= Array();
foreach ($input as $key => $data) {
if (is_array($data)) {
$output[$key] = array_map_r($callback, $data);
} else {
$output[$key] = $callback($data);
}
}
return $output;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment