如何从中获取$ album->的数据?

时间:2011-11-20 06:57:25

标签: php facebook-graph-api

我通过上面的脚本获取专辑信息。如何获取$album->from的数据?

    $response = file_get_contents($token_url);
    if($response=='')   {   echo "<script>window.location='index.php'</script>";    }

     $params = null;
     parse_str($response, $params);

     $graph_url_albums = "https://graph.facebook.com/10150293277371173?access_token=" 
       . $params['access_token'];
     $albums = json_decode(file_get_contents($graph_url_albums));
     }     

    ("token " . $params['access_token']);
    echo $albums_id=$albums->id; echo "</br>";

1 个答案:

答案 0 :(得分:0)

根据Facebook API,Album对象可以访问以下字段:

> id from name description location link cover_photo privacy count type
> created_time updated_time

当你这样做时会发生什么:

echo $albums->from;