【发布时间】:2014-06-24 06:56:13
【问题描述】:
我有以下数组(只是完整数组的一部分),我想提取 [cat_ID] 的值。
Array ([1] => stdClass Object ( [term_id] => 21 [name] => z_aflyst [slug] => z_aflyst
[term_group] => 0 [term_taxonomy_id] => 23 [taxonomy] => category
[description] => [parent] => 0 [count] => 1 [object_id] => 7 [cat_ID] => 21
[cat_name] => z_aflyst ))
所以在这种情况下我需要提取 21。但是,如果cat_name 等于z_aflyst,我只想提取cat_ID。
【问题讨论】:
-
当然你可以用这个作为入门:stackoverflow.com/questions/7694843/…