php - 使用ueditor编辑器 编辑入库的数据 变成json后解析失败 大神来看看
迷茫
迷茫 2017-04-11 10:04:10
[PHP讨论组]

使用ueditor编辑器 编辑入库的数据 变成json后解析失败 大神来看看 [{"ad_id":"4","ad_name":"\u597d\u7684\u5e7f\u544a","ad_images":"http:\/\/lemi.zhe.com\/Upload\/2017-02-12\/58a060297e20f.png","ad_content":"<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u5e7f\u544a2\u5e7f\u544a2<img src="http:\/\/img.baidu.com\/hi\/jx2\/j_0016.gif"\/> &nbsp;<img src="http:\/\/img.baidu.com\/hi\/jx2\/j_0072.gif"\/><img src="http:\/\/img.baidu.com\/hi\/jx2\/j_0052.gif"\/> &nbsp; &nbsp;&nbsp;\u597d\u7684\u5e7f\u544a\u597d\u7684\u5e7f\u544a\u597d\u7684\u5e7f\u544a\u597d\u7684\u5e7f\u544a<\/p>","sort":"1"},{"ad_id":"5","ad_name":"\u7ed3\u5a5a\u5728\u6625\u5b63","ad_images":"http:\/\/lemi.zhe.com\/Upload\/2017-02-12\/58a0603506f04.png","ad_content":"<p>\u9876\u9876\u9876\u9876<img src="http:\/\/img.baidu.com\/hi\/jx2\/j_0047.gif"\/><img src="http:\/\/img.baidu.com\/hi\/jx2\/j_0050.gif"\/><img src="http:\/\/img.baidu.com\/hi\/jx2\/j_0044.gif"\/>\u7ed3\u5a5a\u5728\u6625\u8282<\/p>","sort":"2"}]

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

全部回复(1)
高洛峰

这是因为你的ad_content字段里面的img标签的"没有呗转义,导致json解析失败,所以你要去看看在转换成json的时候这个地方是否有默认做处理~!

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号