array_walk_recursive

It applay a user function recursively to every member of an array

Example

<?php
function func($value,$key){
echo “The key $key has the value $value<br />”;
}
$arr1=array(“p”=>”php”,”a”=>”ASP”);
$arr2=array($arr1,”1″=>”JS”,”2″=>”VS”);
array_walk_recursive($arr2,”func”);
?>

Output

The key p has the value php
The key a has the value ASP
The key 1 has the value JS
The key 2 has the value VS

Share