get_object_vars($object),获取$object对象中的属性,组成一个数组
class person{ public $name="王美人"; public $age = 25; public $birth; } $p = new person(); print_r(get_object_vars($p));
运行结果
Array ( [name] => 王美人 [age] => 25 [birth] => )
邮箱 626512443@qq.com 电话 18611320371(微信) QQ群 235681453
Copyright © 2015-2024
备案号:京ICP备15003423号-3