我在foreach
声明方面遇到了一些问题foreach
.尽管输入语句是一个数组,但它说
Invalid argument supplied for foreach()
Run Code Online (Sandbox Code Playgroud)
我的代码看起来像这样
foreach($res_array as $res)
{
foreach($res as $re)
{
echo $re['shortUrl'];
}
}
Run Code Online (Sandbox Code Playgroud)
我的数组看起来像这样
Array ( [errorCode] => 0 [errorMessage] => [results] => Array ( [http://www.telegraph.co.uk/earth/earthpicturegalleries/5966251/The-weirdest-animals-on-Planet-Earth.html?image=5] => Array ( [hash] => 2qNNV6 [shortUrl] => http://su.pr/2qNNV6 ) ) [statusCode] => OK )
Run Code Online (Sandbox Code Playgroud)
我得到了第二个foreach的错误.请帮我解决这个问题.
归档时间: |
|
查看次数: |
527 次 |
最近记录: |