我需要帮助遍历数组中的数组,我只需要遍历某些数组,例如,我将如何遍历名称数组?
Array
(
[@total_records] => 10
[@total_matching_records] => 10
[@available_records] => 200
[@available_matching_records] => 12
[query] => Array
(
[summary] => Array
(
[emails] => Array
(
[0] => Array
(
[content] => jonathan.lyon@gmail.com
)
)
)
)
[results] => Array
(
[person] => Array
(
[@match_score] => 1
[summary] => Array
(
[names] => Array
(
[0] => Array
(
[first] => Jonathan
[last] => Lyon
[display] => Jonathan Lyon
)
[1] => Array
(
[first] => Jonathan
[last] => Jordan
[display] => Jonathan Jordan
)
)
我已经尝试过了,但无法让它工作:-
foreach($json_output['results']['person']['summary']['names'] as $key => $val) {
echo $key.": ".$val."</br>";
}
任何帮助将不胜感激。
谢谢
乔纳森