Hello,
I am having some problem with foreach
statement.Though the input to foreach
statement is an array, it says
Invalid argument supplied for foreach()
and my code looks like this
foreach($res_array as $res)
{
foreach($res as $re)
{
echo $re['shortUrl'];
}
}
and my array looks like this
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 )
I am getting that error for the second foreach. Please help me with this problem.