在数组中查找所选键的值

时间:2012-06-18 04:24:24

标签: php arrays

我需要找到关键字sub_section_html的价格。

示例:[sub_section_html] =>腰带图像回声[价格]

我通过array_search获取密钥,但如何获得与该条目对应的价格值?

stdClass Object ( [data_id] => 65 [name_short_en] => white [price] => 720 [sub_section] => 1 [sub_section_html] => bodyImage ) 
stdClass Object ( [data_id] => 88 [name_short_en] => brown [price] => 80 [sub_section] => 2 [sub_section_html] => waistbandImage ) 
stdClass Object ( [data_id] => 101 [name_short_en] => white [price] => 70 [sub_section] => 3 [sub_section_html] => collarImage ) 
stdClass Object ( [data_id] => 262 [name_short_en] => Lace/blue/white [price] => 330 [sub_section] => 8 [sub_section_html] => leftsleeveImage ) 

0 个答案:

没有答案