Invalid argument supplied for foreach()
-
Hi, I am trying to use the following in my page but getting the above error:
data as $post) { ?>
[](<?php echo $post->images->standard_resolution->url ?> "<?php echo $post->caption->text ?>")Technology News @ www.JassimRahma.com
-
Hi, I am trying to use the following in my page but getting the above error:
data as $post) { ?>
[](<?php echo $post->images->standard_resolution->url ?> "<?php echo $post->caption->text ?>")Technology News @ www.JassimRahma.com
In any type of foreach loop you pass in a list of items you wish to iterate over. Check what the types are that you are passing into your foreach loop. What are $result and $data? Check that they are of the correct types.
-
Hi, I am trying to use the following in my page but getting the above error:
data as $post) { ?>
[](<?php echo $post->images->standard_resolution->url ?> "<?php echo $post->caption->text ?>")Technology News @ www.JassimRahma.com
Check the content of
$result->data
by using
var_dump($result->data);
You will see the content of your object. However if it is a big object it can be messy You can also use this piece of code given in the comment section of the Traversable interface: http://php.net/manual/en/class.traversable.php#99195[^]