PHP Function Get_Object_Vars
php function get_object_vars gets the non-static properties of the object obj as an associative array. If the variables declared in the class of which obj is an instance have not been assigned a value, those will be returned with a NULL value.
The obj argument can be either an object or a list of objects. This function is useful for getting information about an object, for example to display it in a debugging tool like var_dump or var_export. This function is similar to get_class_vars(), but it is designed specifically for getting information about an object.
The key difference between this function and other methods for getting information about an object is that it uses the obj argument. In addition, this function returns an associative array of the defined object property names and their values.
This method is particularly helpful if you want to see what values are actually in an object, rather than just a list of ''. It is also helpful if you are trying to figure out what to pass into a __sleep() or __wakeup() function that will save and then load an object.
For more on how to use these and other useful php functions, read Hacking with PHP, available now from O'Reilly and online at O'Reilly. Get started with over 1200 pages of hands-on learning today.