【发布时间】:2012-10-05 21:44:22
【问题描述】:
我在一个我不知道如何访问它的数据的对象中“突出显示”了一个 solr 查询的输出。假设我想找回我尝试过的“Black & Red”:
$object->{10304}->color_source_name[0];
$object->{'10304'}->color_source_name[0];
两者都没有给我任何东西。如何访问数据?
这是我在下面引用的对象:
print_r($object);
SolrObject Object
(
[10304] => SolrObject Object
(
[color_source_name] => Array
(
[0] => Black & Red
)
[description] => Array
(
[0] => with their true identity safely masked.Midcalf Lucha Red
)
[name] => Array
(
[0] => Sock It To Me Lucha Red Midcalf
)
[color] => Array
(
[0] => Red
)
)
[4075] => SolrObject Object
(
[color_source_name] => Array
(
[0] => Beige/Red
)
[description] => Array
(
[0] => Very sheer with red tops and Cuban heels and an oh-so-sexy red backseam. These are designed
)
[name] => Array
(
[0] => Two-Tone Red Cuban-Heeled Stockings
)
[color] => Array
(
[0] => Red
)
)
)
【问题讨论】: