Display the drop-down list

array_walk_recursive()

« array_walk | arsort »
<?php
// custom callback functions
function test_alter(&$item1$key$prefix) { $item1 "$prefix$item1"; };
function 
test_print(&$item$key)           { $item "$key holds $item\n"; };

$array =
    
// array $array

$bool array_walk_recursive (
    
// array &$array
    
?// callable $callback
    
  // [mixed $userdata = NULL]
);
?>
Result
$array = [
  
'd' => 'fruit: lemon',
  
'a' => 'fruit: orange',
  
'b' => 'fruit: banana',
  
'c' => 'fruit: apple',
]
$bool = true
Examples
#1 array_walk_recursive  (/* $array = ["sweet" => ["a" => "apple", "b" => "banana"], "sour" => "lemon"] */
 
$array,
 
"test_print")
#2 array_walk_recursive  (/* $array = ["d" => "lemon", "a" => "orange", "b" => "banana", "c" => "apple"] */
 
$array,
 
"test_alter",
 
"fruit")
See also
array_walk, call_user_func