<?php
$tree = [ 1 => [11 => ["a", "b"], 12 => ["a", "b", "3"], 13 => ["1", 2 => [1,2,3,4=>[1,2,3,4]], "a"]],
2 => [21 => [[1, 2], ["a", "b"]], 22=> [1, "a"], 23 => ["a", 2, 3], 24 => [1, 2]],
3 => [31 => ["a", "e"], 32 => [[1,2,3],[4,5,6],[7,8,9]], 33 => [1, "a"] ]
];
//print_r($tree);
function drawArraySneaky ($var) {
echo "+++";
foreach ($var as $name => $value) {
echo "$name:\n";
echo "---";
drawArraySneaky ($value);
echo "---";
}
} else {
echo "";
echo $var . "";
}
}
drawArraySneaky($tree);
PD9waHAKJHRyZWUgPSBbIDEgPT4gWzExID0+IFsiYSIsICJiIl0sIDEyID0+IFsiYSIsICJiIiwgIjMiXSwgMTMgPT4gWyIxIiwgMiA9PiBbMSwyLDMsND0+WzEsMiwzLDRdXSwgImEiXV0sCgkJCQkyID0+IFsyMSA9PiBbWzEsIDJdLCBbImEiLCAiYiJdXSwgMjI9PiBbMSwgImEiXSwgMjMgPT4gWyJhIiwgMiwgM10sIDI0ID0+IFsxLCAyXV0sCgkJCQkzID0+IFszMSA9PiBbImEiLCAiZSJdLCAzMiA9PiBbWzEsMiwzXSxbNCw1LDZdLFs3LDgsOV1dLCAzMyA9PiBbMSwgImEiXSBdCgkJCQkKCQldOwoKLy9wcmludF9yKCR0cmVlKTsKCmZ1bmN0aW9uIGRyYXdBcnJheVNuZWFreSAoJHZhcikgewoJaWYoaXNfYXJyYXkoJHZhcikpIHsKCQllY2hvICIrKysiOwoJCWZvcmVhY2ggKCR2YXIgYXMgJG5hbWUgPT4gJHZhbHVlKSB7CgkJCWVjaG8gIiRuYW1lOlxuIjsKCQkJZWNobyAiLS0tIjsKCQkJZHJhd0FycmF5U25lYWt5ICgkdmFsdWUpOwoJCQllY2hvICItLS0iOwoJCX0KCX0gZWxzZSB7CgkJZWNobyAiIjsKCQllY2hvICR2YXIgLiAiIjsKCX0KCQp9CgoKZHJhd0FycmF5U25lYWt5KCR0cmVlKTs=