更新时间:2023-02-15 15:14:34
您具有受保护的私有属性,因此无法使用任何函数(包括json_encode())直接访问对象的属性.
You have protected and private attributes, so you can not use any functions, including json_encode() to access directly to your object's property.
使用 JSONSerialize
php json_encode 返回空值
php json_encode返回null
PHP json_encode返回空结构
php timezone返回空数组
[PHP] 为JSON数据的API返回空数组或者空对象