Accessing array object keys
-
I’m trying to get the total number of posts in a specific taxonomy.
This
$totals=array( 'antique_silverware' => 'mugs', 'post_type' => 'stock_silverware', 'post_status' => 'publish', );
returns this
Array ( [antique_silverware] => Array ( [26] => 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.
:-p
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Accessing array object keys’ is closed to new replies.