我从数据库查询返回此数组。我不确定如何检索[url]的值?
请指教。谢谢。
Array (
[1] => Array (
[0] => Array (
[url] => ''
[poster] => ''
[skin] => siteorigin
[ratio] => 1.777
[autoplay] => 0
[info] => Array (
[grid] => 0
[cell] => 0
[id] => 0
[class] => ''
)
)
[1] => Array (
[title] =>
[text] => ''
[filter] => 1
[info] => Array (
[grid] => 1
[cell] => 0
[id] => 1
[class] => WP_Widget_Text
)
)
)
答案 0 :(得分:1)
如果您只是试图从该特定数组中获取值,这应该可以正常工作:
$arr[1][0]['url']
多维数组只是数组中的数组,因此每个括号运算符都会生成一个新数组,在获得所需值之前,可以对其进行额外的解引用。