0
[1] => Array
(
[0] => stdClass Object
(
[term_id] => 21
[name] => House
[slug] => house
[term_group] => 0
[term_taxonomy_id] => 21
[taxonomy] => product_cat
[description] =>
[parent] => 16
[count] => 2
[filter] => raw
)
[1] => stdClass Object
(
[term_id] => 12
[name] => stone
[slug] => stone
[term_group] => 0
[term_taxonomy_id] => 12
[taxonomy] => product_cat
[description] =>
[parent] => 8
[count] => 1
[filter] => raw
)
)
的數組,我需要檢查[parent]
值對象的值。 但作爲家長指http://php.net/manual/en/keyword.parent.php
使用類似:
foreach ($array_entry as $object) {
if ($object->parent === $something) {
....
} else {
....
}
}
不起作用。 如何訪問父級值? 我試過'parent'
,但仍然無法正常工作。