我有一个数组,我似乎无法取回我的数据。我想要的是每个名称(test1 ...)都有多个与它们关联的网址。如果你看最后一个测试(test5),有2个url,但是这个foreach循环只给了我一个。为什么?PHP数组foreach问题
这里是数组结构和我的foreach循环。
Array
(
[test1] => Array
(
[0] => http://www....
)
[test2] => Array
(
[0] => http://www....
)
[test3] => Array
(
[0] => http://www....
)
[test4] => Array
(
[0] => http://www....
)
[test5] => Array
(
[0] => http://www.yahoo.com
[1] => http://www.google.com
)
)
foreach($source as $name=>$url)
{
foreach($url as $_url);
{
echo $name.' - ';
echo $_url.'<br>';
}
}
OMG ......我无法相信我错过了。 :) 谢谢! – John 2009-12-21 04:38:58