The raw output of my object is when I do a print_r is:
Array ( [0] => stdClass Object ( [COUNT(*)] => 3 ) )
How do I get to the 3?
This object is the result of a sql query inside wordpress with the $wpdb class.
I am a noob at PHP objects. Also would like to know
- where do I learn to do object parsing stuff like this?
- What kind of object is this? Why is it wrapped in an Array?
UPDATE: here's the source code:
global $wpdb;
$post_count = $wpdb->get_results("SELECT COUNT(*) FROM $wpdb->posts");
print_r($post_count);
SELECT count(*) AS total FROM ....