This article mainly introduces the usage of get_object_vars() method in php, and analyzes the use of get_object_vars() method to obtain attributes in objects with examples. Tips, friends in need can refer to it
This article analyzes the usage of get_object_vars() method in PHP with examples. Share it with everyone for your reference. The specific analysis is as follows:
Syntax: get_object_var($object), returns an array. Get the attributes in the $object object and form an array
Example:
?
3 4
5
6
9 |
|
?>
1 | Array ( [name] => 王美人 [age] => 25 [birth] => ) |