这里的价值是与obj:我如何获得一个OBJ标签
array(2) {
[0]=> object(stdClass)#538 (9)
{
["term_id"]=> string(3) "152"
["name"]=> string(19) "Éducation physique"
["slug"]=> string(18) "education-physique"
["term_group"]=> string(1) "0"
["term_taxonomy_id"]=> string(3) "159"
["taxonomy"]=> string(11) "product_cat"
["description"]=> string(0) ""
["parent"]=> string(3) "123"
["count"]=> string(1) "3"
}
[1]=> object(stdClass)#540 (9)
{
["term_id"]=> string(3) "123"
["name"]=> string(5) "Sport"
["slug"]=> string(5) "sport"
["term_group"]=> string(1) "0"
["term_taxonomy_id"]=> string(3) "123"
["taxonomy"]=> string(11) "product_cat"
["description"]=> string(0) ""
["parent"]=> string(1) "0"
["count"]=> string(2) "49"
}
}
mam :
我试图获得的价值:[term_id] 152我需要它为“152”的值在变量。我尝试:$product_category->term_id
它返回“一无所有” 和我尝试:$product_category['term_id']
它返回“一无所有”
如何是“正确”的方式提前从对象retreive值
的感谢!
孩子,我看起来很愚蠢,当它全部在一行时就很难看清......你是绝对正确的......两个对象,我必须选择一个......我的错! – menardmam 2013-02-25 21:12:08
非常好 - 很高兴帮助 – Hobo 2013-02-25 21:20:05