I found the following code, which prints all the elements of an array fine. How can I modify it to print a key one time and then all the values corresponding to the key, the
function printAll($a) { if (!is_array($a)) { echo $a, ' '; return; } foreach($a as $k => $value) { if($k<10){ printAll($k); printAll($value); } } }