我有帶回這種反應如何解析Facebook的圖形API響應
Facebook\GraphObject Object
(
[backingData:protected] => Array
(
[data] => Array
(
[0] => stdClass Object
(
[id] => 111
[from] => stdClass Object
(
[id] => 111
[name] => fo bar
)
[name] => etc
)
我試圖做$reponse->{'backingData:protected'}
但它不工作一個Facebook圖形API請求。
另外,下一組結果是圖api的鏈接,但是結果是純json。
[paging] => stdClass Object
(
[cursors] => stdClass Object
(
[after] => MTI3NzMzMTQwMzYy
[before] => MTAxNTQzNjI5NTY1NDAzNjM=
)
[next] => https://graph.facebook.com/v2.0/111/albums?access_token=xxxxv&limit=25&after=yyy
)
我的代碼
$user_profile = (new FacebookRequest(
$session, 'GET', '/me/albums'
))->execute()->getGraphObject();
echo '<pre>'; print_r($user_profile); echo '</pre>';
'$ response-> data [0] - > id'我認爲 – WizKid
可以在這裏發佈php代碼嗎? – bhushya
不,我不能使用類型的Facebook \ GraphObject的對象作爲數組' – user9418