How do I convert an object to an array?
php
Solution
You should look at get_object_vars , as your properties are declared private you should call this inside the class and return its results.
Be careful, for primitive data types like strings it will work great, but I don't know how it behaves with nested objects.
in your case you have to do something like;
<?php
print_r(get_object_vars($response->response->docs));
?>
Problem
``` <?php print_r($response->response->docs); ?> ``` Outputs the following: ``` Array ( [0] => Object ( [_fields:private] => Array ( [id]=>9093 [name]=>zahir ) Object ( [_fields:private] => Array ( [id]=>9094 [name]=>hussain ).. ) ) ``` How can I convert this object to an array? I'd like to output the following: ``` Array ( [0]=> ( [id]=>9093 [name]=>zahir ) [1]=> ( [id]=>9094 [name]=>hussain )... ) ``` Is this possible?