我这样做是为了获取类别名称,我得到了数组
Array ( [0] => stdClass Object ( [term_id] => 4 [name] => cinematography [slug] => cinematography [term_group] => 0 [avhec_term_order] => 1 [term_taxonomy_id] => 4 [taxonomy] => category [description] => [parent] => 0 [count] => 11 [object_id] => 2526 [cat_ID] => 4 [category_count] => 11 [category_description] => [cat_name] => cinematography [category_nicename] => cinematography [category_parent] => 0 ) )
为此我写了
$category = get_the_category();
print_r($category);
现在我如何将“[name] => cinematography”存储在变量中。