php - 使用ueditor编辑器 编辑入库的数据 变成json后解析失败 大神来看看

查看:315
本文介绍了php - 使用ueditor编辑器 编辑入库的数据 变成json后解析失败 大神来看看的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问 题

使用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"}]

解决方案

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

这篇关于php - 使用ueditor编辑器 编辑入库的数据 变成json后解析失败 大神来看看的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆