如何显示这样的数组?
Array (
[0] => Array (
[dogs] => Array (
[Cordillera Autonomous Region (CAR)] => Array (
[link] => /search/veterinarians/?vet&provid=1&animal=ZG9ncw==&keyword=Abra&keysearch=QWJyYQ==&c
[city] => Abra
)
)
)
答案 0 :(得分:0)
我相信你很可能正在寻找类似于此的输出:
<?php
foreach ($array as $subarray) {
foreach ($subarray as $category) {
foreach ($category as $key => $value) {
echo $key . ' : <a href="' $value['link'] . '">' . $value['city'] '</a>';
}
}
}
?>
完全取决于您实际输出数据的方式,但它的结构适合于类似于此的输出。您可以在PHP中轻松嵌套foreach
循环。