Reputation: 331
I can't echo $graphObject['location']['name'] from this array:
array(6) {
["birthday"]=>
string(10) "09/09/1989"
["location"]=>
object(stdClass)#8 (2) {
["id"]=>
string(15) "110526485641433"
["name"]=>
string(17) "Augsburg, Germany"
}
["locale"]=>
string(5) "de_DE"
["timezone"]=>
int(2)
["updated_time"]=>
string(24) "2014-06-20T08:24:24+0000"
["verified"]=>
bool(true)
}
How to do that right?
Upvotes: 0
Views: 579
Reputation: 306
The $graphObject['location']
is not an array.
You can check that it says ["location"]=>object(stdClass).
It's and stdClass Object, so you can fetch the variable like this:
$graphObject['location']->name;
That's all.
Upvotes: 2