Я просто напечатать facebook апи resonseКак пройти этот объект PHP
print_r($response)
выход
Facebook\GraphNodes\GraphEdge Object
(
[request:protected] => Facebook\FacebookRequest Object
(
[app:protected] => Facebook\FacebookApp Object
(
[id:protected] => secret
[secret:protected] => secret
)
[accessToken:protected] => secret
[method:protected] => GET
[endpoint:protected] => /search?q=co&type=page
[headers:protected] => Array
(
[Content-Type] => application/x-www-form-urlencoded
)
[params:protected] => Array
(
)
[files:protected] => Array
(
)
[eTag:protected] =>
[graphVersion:protected] => v2.5
)
[metaData:protected] => Array
(
[paging] => Array
(
[cursors] => Array
(
[before] => MAZDZD
[after] => MjQZD
)
[next] => https://graph.facebook.com/v2.8/search?access_token=EAAafvw8PPA4BACHY8V6GDpbzMbtRlZC7dZCRnOGtO26Yc4g4yWWvqZCsMBPOWO3b72n2JPjXP8KD91ZCMXMAcARGUsk5cNShhy5LxOmj0Gz4ZA2ESzPZAd4VzBCpdZATCZBvZCOkAIxBd1gXBzkMY0DheyjruSlMHEPbbuVuTY350wgZDZD&q=co&type=page&limit=25&after=MjQZD
)
)
[parentEdgeEndpoint:protected] =>
[subclassName:protected] =>
[items:protected] => Array
(
[0] => Facebook\GraphNodes\GraphNode Object
(
[items:protected] => Array
(
[name] => SC Corinthians Paulista
[id] => 132769576762243
)
)
[1] => Facebook\GraphNodes\GraphNode Object
(
[items:protected] => Array
(
[name] => Miranda Cosgrove
[id] => 9934379006
)
Я хочу получить доступ к [items:protected]
массив .Но я не могу найти, как получить их
Я попробовал
$ items_array = $ response-> items: protected;
Но это не работает, пожалуйста, помогите мне. Я хочу получить этот массив и перебрать его
Вы не можете получить доступ к защищенным типы данных –
действительно, не так? @MASIDDIQUI – beginner
Я полагаю, вы можете перебирать элементы с помощью простого 'foreach', как показано здесь: https://developers.facebook.com/docs/php/GraphEdge/5.0.0 –