2014-03-18 64 views

回答

1

您可以從以下網址檢索數據: -

https://graph.facebook.com/USERNAMEORID?fields=id,name,first_name,last_name,picture 

替換 「USERNAMEORID」 到fb用戶名或指定用戶的ID。

+0

謝謝!你能否也請告訴我如何導出這些數據? – user1829531

+0

我評論了答案更多的說明。 –

0

可以如下獲取這些數據: -

<?php 
$content = file_get_contents('https://graph.facebook.com/myid?fields=id,name,first_name,last_name,picture'); 

$content = json_decode($content, true); 
print_r($content); // <- this print data as associative array, You can fetch it and get data 
?> 

我添加了一個json_decode功能,以您的代碼,而即將到來的形式Facebook的圖表中的數據是json格式,所以我用這個函數轉換json格式對象,然後我用true參數使這個對象成爲關聯數組。現在你可以像任何數組一樣正常地獲取這個數組。

如果您需要其他東西告訴我,我很樂意提供幫助。

相關問題