我正在尝试获取此结构显示的十二个 ID:
stdClass Object
(
[checkins] => stdClass Object
(
[count] => 12
[items] => Array
(
[0] => stdClass Object
(
[venue] => stdClass Object
(
[id] => 4564654646456
.
.
我愿意:
$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>"
}
但我得到:致命错误:不能将 stdClass 类型的对象用作行中的数组..
请有人可以告诉我如何做到这一点?
非常感谢