Accessing array object keys
I’m trying to get the total number of posts in a specific taxonomy.
$totals=array( 'antique_silverware' => 'mugs', 'post_type' => 'stock_silverware', 'post_status' => 'publish', );
Array ( [antique_silverware] => Array (  => stdClass Object ( [term_id] => 26 [name] => Mugs [slug] => mugs [term_group] => 0 [term_taxonomy_id] => 130 [taxonomy] => antique_silverware [description] => [parent] => 0 [count] => 8 [object_id] => 688 ) ) [post_type] => stock_silverware [post_status] => publish )
I need to access
[count] => 8
I totally stuck on how to access this…
I’ve tried using get_object_vars($totals) but I presume it doesn’t work because the object is within an array?
Many thanks in advance.
- The topic ‘Accessing array object keys’ is closed to new replies.