阵列总是让我大吃一惊,即使是最简单的任务有时候也是不可能的!
我需要从[exact_matches]中读取[total]的值。我该怎么做?
$result = Array (
[exact_matches] => Array (
[total] => 0
[members] => Array ( )
),
[full_search] => Array (
[total] => 1
[members] => Array ( )
)
)
提前感谢您的帮助!
答案 0 :(得分:0)
对于第一级,你会这样做,
$total = $result['exact_matches']['total']; which would return 0;
第二个总数
$total = $result['exact_matches']['full_search']['total']
将返回1;
答案 1 :(得分:-1)
First Total:
echo $result['exact_matches']['total'];
第二次总计:
echo $result['exact_matches']['total']['full_search']['total'];
我不知道你想要哪一个