facebook php sdk - Notice: Undefined index php sdk for Graph API -


i send facebook request using graph api , array below result. when trying execute code:

$a=count($obj_1['events']->data);

i following message

notice: undefined index: events

i have tried like:

$obj_1[0]->events->data $obj_1->events->data                  $object[0]->['events']->data 

and googled trying figure out. trying rid of notice because script runs intended... pls :)

 array(         [events] => stdclass object             (                 [data] => array                     (                         [0] => stdclass object                             (                                 [name] =>                                  [start_time] =>                                  [timezone] =>                                  [id] =>                              )                      )                  [paging] => stdclass object                     (                         )             )         [id] =>      ) 

try replace: if print_r($obj_1); line work replace following..

$a=count($obj_1['events']->data); 

to

$tmpobj=$obj_1["events"]; $a=count($tmpobj->data); 

Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -