重庆小潘seo博客

当前位置:首页 > 重庆网络营销 > 小潘杂谈 >

小潘杂谈

微信开发中json格式不正确怎么办

时间:2020-09-11 19:00:06 作者:重庆seo小潘 来源:
问题: 使用PHP语言进行微信开发时,在创建卡券的时候出现数据格式错误,错误返回信息如下:{“errcode”:47002,”errmsg”:”data format error, do NOT use json unicode encode (uxxxxuxxxx), please use utf8 encoded text! hint: [udJhFa0680e569]”}解

微信开发中json格式不正确怎么办

问题:

使用PHP语言进行微信开发时,在创建卡券的时候出现数据格式错误,错误返回信息如下:{“errcode”:47002,”errmsg”:”data format error, do NOT use json unicode encode (uxxxxuxxxx), please use utf8 encoded text! hint: [udJhFa0680e569]”}解决办法:

使用PHP中的json_encode函数时加上参数JSON_UNESCAPED_UNICODE即可,如:json_encode($arr,JSON_UNESCAPED_UNICODE)以上就是微信开发中json格式不正确怎么办的详细内容,更多请关注小潘博客其它相关文章!