You cannot access the members of an object using the array indexing operator [] .
You should use the operator -> :
$x = new StdClass(); $x->member = 123;
In your case, you have to use a mixture, since you have an object ( $checkins ) with a member ( $items ), which is an array that contains additional objects.
$a1[] = $checkins->items[$i]->venue->id;
source share