来自facebook图表api的多级JSON数据[关闭]

Hi I am trying to access latitude & longitude values from here->

https://graph.facebook.com/79537378027/albums

here is what I am trying

$File= file_get_contents('https://graph.facebook.com/79537378027/albums');
$p=json_decode($File);
foreach ($p->data as $loc)
{
echo $loc->place[0].latitude;}

But I am not getting values. If I try with simple $loc->latitude it won't give me anything as latitude is a sub-child of place.

Try this:

<?php

$File= file_get_contents('https://graph.facebook.com/79537378027/albums');
$p=json_decode($File);
foreach ($p->data as $loc)
{
    if($loc->place) {
        echo $loc->place->location->latitude;
    }
}

?>