【发布时间】:2016-08-09 15:15:14
【问题描述】:
上下文
我试图参考下面的价值:
Array (
[0] => stdClass Object (
[label] => John Smith
[attributes] => Array (
[class] => sf-level-0 sf-item-14
)
[value] => smith-john
[depth] => 0
[count] => 3
)
[1] =>... etc.
问题
假设数组名为 $array,那么正确的格式是什么?我试过array[0]->['value'],但它不起作用。
【问题讨论】:
-
$array[0]->value 应该是您需要的。你忘记
$了吗? -
我有
$- 也刚刚添加到这里。这有效,感谢您的回答和重新格式化!