可能重复:
从数组中删除索引键以访问对象?
我需要能够访问该term_id
值,但我不知道与数组关联的数字或索引。我怎样才能访问它?
我想像这样访问它$value->term_id
,现在我需要通过将数字放在值($value->[26]->term_id
)之后来访问它。
Array
(
[26] => stdClass Object
(
[term_id] => 26
[name] => Night Life.
[slug] => shopping-and-night-life
[term_group] => 0
[term_taxonomy_id] => 28
[taxonomy] => map_categories
[description] => Most of the late night clubs, bars and pubs in Victoria are situated downtown. Here are a few to check out:
[parent] => 0
[count] => 6
[object_id] => 925
)
)