请问获取到object类型的数据如何转换成数组 [ 2.0 版本 ]
是object类型,不是std Object这种
如下:
object(test\myyii\models\Customer)#67 (8) { ["_attributes":"yii\db\BaseActiveRecord":private]=> array(7) { ["id"]=> int(7) ["username"]=> string(6) "老王" ["admin_id"]=> string(1) "0" ["company_id"]=> string(1) "2" ["id_card"]=> string(18) "510321199201012234" ["telphone"]=> string(11) "15877556633" ["created_at"]=> int(1467104334) } ["_oldAttributes":"yii\db\BaseActiveRecord":private]=> array(7) { ["id"]=> int(7) ["username"]=> string(6) "老王" ["admin_id"]=> string(1) "0" ["company_id"]=> string(1) "2" ["id_card"]=> string(18) "510321199201012234" ["telphone"]=> string(11) "15877556633" ["created_at"]=> int(1467104334) } ["_related":"yii\db\BaseActiveRecord":private]=> array(0) { } ["_errors":"yii\base\Model":private]=> NULL ["_validators":"yii\base\Model":private]=> NULL ["_scenario":"yii\base\Model":private]=> string(7) "default" ["_events":"yii\base\Component":private]=> array(0) { } ["_behaviors":"yii\base\Component":private]=> array(0) { } }
最佳答案
其他 2 个回答
hebo5485
注册时间:2016-03-18
最后登录:2024-04-05
在线时长:66小时28分
最后登录:2024-04-05
在线时长:66小时28分
- 粉丝8
- 金钱4600
- 威望30
- 积分5560