我做了一個項目,在這個項目的一部分,我想保存從graph.facebook.com得到的數據,現在我的項目的示例輸出,我從facebook圖形API。 :我怎樣才能使用提取的數據從facebook圖形api
Facebook\GraphObject Object
(
[backingData:protected] => Array
(
[data] => Array
(
[0] => stdClass Object
(
[message] => Automated XML Site Map Generator
http://pastebin.com/xjJe38dp
[id] => 103114753133019_371405176303974
[updated_time] => 2013-04-26T05:36:35+0000
)
[1] => stdClass Object
(
[message] => Simple but powerful DB class
http://pastebin.com/1qgxUrwX
[id] => 103114753133019_371404696304022
[updated_time] => 2013-04-26T05:34:23+0000
)
[2] => stdClass Object
(
[message] => Convert Existing DB to Unicode
http://pastebin.com/pHu08cPs
[id] => 103114753133019_371404609637364
[updated_time] => 2013-04-26T05:33:50+0000
)
)
[paging] => stdClass Object
(
[previous] => https://graph.facebook.com/v2.2/103114753133019/feed?fields=message&since=1366954595&access_token=425591634259397|AQumfoxQyU3wAyt3sM37sYM9sp8&limit=25&__paging_token=enc_AexpCrJr7NTOG02uEaXs6pqjd11UjEohZJLjXZrWeYLOsE9hPX7WQTLemXIGMpzdFXEDdDUQj3qdwOqEbmlAfX4TREbZ-3GAfkKiUZ44kHGYLw&__previous=1
[next] => https://graph.facebook.com/v2.2/103114753133019/feed?fields=message&access_token=425591634259397|AQumfoxQyU3wAyt3sM37sYM9sp8&limit=25&until=1366954430&__paging_token=enc_AeyPm9mOsK3T9J0JNkIyQQqxfS7hLDe5GCs-IRLQWPOOzma8v9Rzvw8awxxE0GMQhx-rfs99X7TpUGw5f7HNgPnTKh11WbGC5Yj7GyW7s2VqoA
)
)
)
,你可以看到我打印theese代碼運行:
$request = new FacebookRequest($session, 'GET', '/a page id/feed'.$sfield);
$response = $request->execute();
// get response
$graphObject = $response->getGraphObject();
// print data
echo '<pre>' . print_r($graphObject, 1) . '</pre>';
所以現在我想的郵件保存到一個文件,或者當我想用$ graphObject作爲數據庫陣列它給了我一個錯誤:
Fatal error: Cannot use object of type Facebook\GraphObject as array in /home/micengco/public_html/parser/facebook.php on line 34
所以我怎麼能做到這一點?
我在哪裏可以找到完整的文檔 – simba 2014-12-13 18:08:38
你是指由Facebook的文檔? – nitigyan 2014-12-13 18:10:17
任何,來自Facebook或其他任何地方! – simba 2014-12-14 11:48:44