<?php
//header("Content-Type: text/plain; charset=utf-8");
$tree = ["Россия" => [
"Москва" => [
"МГУ" => [
"Вася",
"Петя" => [3,4,5,3],
"Маша",
"Даша",
"Рома"
],
"МГТУ" => [
"Степа",
"Валя",
"Педаля"
],
"МГИМО" => [
"Клава",
"Саша"
],
"МИФИ" => [
"Оля",
"Митя"
]
],
"Питер" => [
"СпбГУ" => [
"Вася",
"Петя" => [5,5,5,5],
"Даша",
"Рома"],
"СпбМТУ" => [
"Оля",
"Митя"],
"СпбТИ" => [
"Юра",
"Шура",
"Шкура"]
],
"Новосибсрик" => [
"НГУ" => [
"Антон",
"Питон",
"Валя"],
"НГТУ" => [
"Краля",
"Уля"]
],
]
];
//print_r($tree);
function drawArraySneaky ($var) {
echo "<ul>";
foreach ($var as $name => $value) {
echo "<li>";
echo "$name:";
}
drawArraySneaky ($value);
echo "</li>";
}
echo "</ul>";
} else {
echo $var;
}
}
drawArraySneaky($tree);
PD9waHAKZXJyb3JfcmVwb3J0aW5nKC0xKTsKLy9oZWFkZXIoIkNvbnRlbnQtVHlwZTogdGV4dC9wbGFpbjsgY2hhcnNldD11dGYtOCIpOwoKJHRyZWUgPSBbItCg0L7RgdGB0LjRjyIgPT4gWwoJCQkJItCc0L7RgdC60LLQsCIgPT4gWwoJCQkJCQkJItCc0JPQoyIgPT4gWwoJCQkJCQkJCQkJItCS0LDRgdGPIiwKCQkJCQkJCQkJCSLQn9C10YLRjyIgPT4gWzMsNCw1LDNdLAoJCQkJCQkJCQkJItCc0LDRiNCwIiwKCQkJCQkJCQkJCSLQlNCw0YjQsCIsCgkJCQkJCQkJCQki0KDQvtC80LAiCgkJCQkJCQkJCQldLAoJCQkJCQkJItCc0JPQotCjIiA9PiBbCgkJCQkJCQkJCQki0KHRgtC10L/QsCIsCgkJCQkJCQkJCQki0JLQsNC70Y8iLAoJCQkJCQkJCQkJItCf0LXQtNCw0LvRjyIKCQkJCQkJCQkJXSwKCQkJCQkJCSLQnNCT0JjQnNCeIiA9Pi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