<?php
$sweet = ['a' => 'apple', 'b' => 'banana'];
$fruits = ['sweet' => $sweet, 'sour' => 'lemon'];
function test_update(&$item)
{
$item = strtoupper($item);
}
function test_print($item, $key)
{
echo "$key holds $item\n";
}
array_walk_recursive($fruits, 'test_update');
array_walk_recursive($fruits, 'test_print');
?>
The above example will output:
a holds APPLE
b holds BANANA
sour holds LEMON