嗨我需要得到一个var的值,使其成为var_dump($ var)后得到:
array(1) {
["docs"]=> array(3) {
[0]=> array(1) {
["imgurl"]=> string(68) "http://xxxxx.com/demos/grider/wp-content/uploads/2013/02/22.jpg" }
[1]=> array(1) {
["imgurl"]=> string(68) "http://xxxxx.com/demos/grider/wp-content/uploads/2013/02/33.jpg" }
[2]=> array(1) {
["imgurl"]=> string(68) "http://xxxxx.com/demos/grider/wp-content/uploads/2013/02/22.jpg" } } }
我需要以http://
开头的2个img url字符串任何帮助都将不胜感激。
谢谢
答案 0 :(得分:2)
这应该有效:
foreach($var['docs'] as $sub) {
echo $sub['imgurl'];
}
答案 1 :(得分:1)
foreach ($arr['docs'] AS $key => $link) {
echo $link['imgurl'].'<br />';
}