php如何读取多维数组中的name值
数组结构输出如下,我想获取name的值,怎么写Array([realms]=>Array([0]=>Array([type]=>pve[population]=>medi...
数组结构输出如下,我想获取name的值,怎么写
Array
(
[realms] => Array
(
[0] => Array
(
[type] => pve
[population] => medium
[queue] =>
[wintergrasp] => Array
(
[area] => 1
[controlling-faction] => 0
[status] => 0
[next] => 1387030098418
)
[tol-barad] => Array
(
[area] => 21
[controlling-faction] => 0
[status] => 0
[next] => 1387029118559
)
[status] => 1
[name] => 天空
[slug] => 天空
[battlegroup] => Battle Group 9
[locale] => zh_CN
[timezone] => Asia/Shanghai
)
[1] => Array
(
[type] => pve
[population] => medium
[queue] =>
[wintergrasp] => Array
(
[area] => 1
[controlling-faction] => 0
[status] => 0
[next] => 1387030009098
)
[tol-barad] => Array
(
[area] => 21
[controlling-faction] => 0
[status] => 0
[next] => 1387029086239
)
[status] => 1
[name] => 大地
[slug] => 大地
[battlegroup] => Battle Group 9
[locale] => zh_CN
[timezone] => Asia/Shanghai
)
)
)
也就是说,如何获取天空和大地,这两个值 展开
Array
(
[realms] => Array
(
[0] => Array
(
[type] => pve
[population] => medium
[queue] =>
[wintergrasp] => Array
(
[area] => 1
[controlling-faction] => 0
[status] => 0
[next] => 1387030098418
)
[tol-barad] => Array
(
[area] => 21
[controlling-faction] => 0
[status] => 0
[next] => 1387029118559
)
[status] => 1
[name] => 天空
[slug] => 天空
[battlegroup] => Battle Group 9
[locale] => zh_CN
[timezone] => Asia/Shanghai
)
[1] => Array
(
[type] => pve
[population] => medium
[queue] =>
[wintergrasp] => Array
(
[area] => 1
[controlling-faction] => 0
[status] => 0
[next] => 1387030009098
)
[tol-barad] => Array
(
[area] => 21
[controlling-faction] => 0
[status] => 0
[next] => 1387029086239
)
[status] => 1
[name] => 大地
[slug] => 大地
[battlegroup] => Battle Group 9
[locale] => zh_CN
[timezone] => Asia/Shanghai
)
)
)
也就是说,如何获取天空和大地,这两个值 展开
展开全部
echo $a['realms'][0][name] //结果就是name的值
foreach ( $a['realms'] as item) { // 0- 1 二个数组
echo $item['name'];
}
foreach ( $a['realms'] as item) { // 0- 1 二个数组
echo $item['name'];
}
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
foreach ( $a['realms'] as item) {
echp $item['name'];
}
echp $item['name'];
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
一级一级读!!!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询