语法:get_object_var($object),返回一个数组。获取$object对象中的属性,组成一个数组 实例:
<?php
class
person{
public
$name
=
"王美人"
;
public
$age
= 25;
public
$birth
;
}
$p
=
new
person();
print_r(get_object_vars(
$p
));
?>
输出结果: Array ( [name] => 王美人 [age] => 25 [birth] => )