I'm trying to get the twelve ids that this structure shows:
stdClass Object
(
[checkins] => stdClass Object
(
[count] => 12
[items] => Array
(
[0] => stdClass Object
(
[venue] => stdClass Object
(
[id] => 4564654646456
.
.
I do:
$checkins = $fsObjUnAuth->get("/users/self/checkins");
$count = $checkins ->response->checkins->count; // so I can get 12
for( $i = 0; $i < $count; $i ++)
{
$a1[] = $checkins['items'][$i]['venue']['id']; //two tries
$a2[] = $checkins ->response->checkins->items->$i->venue->id;
echo $i; echo ": ";
echo $a1;echo"<br>";
echo $a2;echo"<br>"
}
But I get: Fatal error: Cannot use object of type stdClass as array in line..
Please can someone show me how to do this?
Thanks a lot