I'm trying to read an array and echo one of the variables in the array, like this:
foreach($result->http_response_body as $obj) {
echo $obj->items['address'];
}
The array looks like this when i print it:
stdClass Object
(
[http_response_body] => stdClass Object
(
[total_count] => 1322
[items] => Array
(
[0] => stdClass Object
(
[created_at] => Thu, 15 Jan 2015 08:35:06 GMT
[tag] => *
[id] => 54b77bba55edfbe50e662d3a
[address] => [email protected]
)
[1] => stdClass Object
(
[created_at] => Thu, 15 Jan 2015 08:34:40 GMT
[tag] => *
[id] => 54b77ba055edfbe50e662cf6
[address] => [email protected]
)
[2] => stdClass Object
(
[created_at] => Thu, 15 Jan 2015 08:31:56 GMT
[tag] => *
[id] => 54b77afc55edfbe50e662b0d
[address] => [email protected]
)
But with my script i het this message:
Notice: Trying to get property of non-object in /home/xxxxxxxx/domains/xxxxxxx.xx/public_html/MailGun/watchUnsubscribes.php on line 27
What did I do wrong?