首页> 开发问题 >后端问题 后端问题

TP6报错致命错误: Cannot use object of type stdClass as array

作者:小萝卜 2022-11-02 浏览 877

简介今天在使用tp6时报错,致命错误: Cannot use object of type stdClass as array。我后端解析了一个josn数组,然后前端使用时报的这个错误

今天在使用tp6时报错,致命错误: Cannot use object of type stdClass as array。我后端解析了一个josn数组,然后前端使用时报的这个错误



代码是这样的:

$this_info    = json_decode($data['payment_info']);

修改后:

$this_info    = json_decode($data['payment_info'],true);

问题解决!

很赞哦! (0)

文章评论

    高端网站建设