- print_r: documentation ( source)
- array_walk_recursive: documentation ( source)
<?php
$array = array("red"=>"apple","blue"=>"sky","orange"=>"juice");
$output = array(); // or, $output = null;
$closure = function($element) use(&$output) {
{
$output[] = $element;
}
};
array_walk_recursive($array, $closure);
print_r($output);
/**
Array
(
[0] => apple
[1] => sky
[2] => juice
)
**/