<html>
<body>
function myfunction($value,$key)
{
echo "The key $key has the value $value<br>";
}
$a1=array("a"=>"red","b"=>"green");
$a2=array($a1,"1"=>"blue","2"=>"yellow");
array_walk_recursive($a2,"myfunction");
</body>
<!-- Mirrored from www.w3schools.com/php/phptryit.asp?filename=tryphp_func_array_walk_recursive by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 02:50:53 GMT -->
</html>