This article describes the usage of the get_object_vars () method in php. The example shows how to use the get_object_vars () method to obtain attributes in an object. For more information, see
This article describes the usage of the get_object_vars () method in php. The example shows how to use the get_object_vars () method to obtain attributes in an object. For more information, see
This article analyzes the usage of the get_object_vars () method in php. Share it with you for your reference. The specific analysis is as follows:
Syntax: get_object_var ($ object), returns an array. Obtains the attributes of $ object to form an array.
Instance:
<? Phpclass person {public $ name = ""; public $ age = 25; public $ birth;} $ p = new person (); print_r (get_object_vars ($ p);?>
Output result:
Array ([name] => Wang Mei [age] => 25 [birth] =>)
I hope this article will help you with php programming.