Array
(
[1] => stdClass Object
(
[position] => 1
[priority] => 1
[percentage] => 100
)
[131] => stdClass Object
(
[position] => 11
[priority] => 12
[percentage] => 80
)
)
这是我的对象数组。
为什么我不能像这样得到对象:$ a = $ niz [1]?
答案 0 :(得分:1)
将stdClass对象转换为php数组,以便您可以通过正常方式访问它。
$niz = get_object_vars($niz);
$a = $niz[1];
print_r($a);