作者:单莼de笑脸 | 来源:互联网 | 2022-02-03 04:55
微信开发中json格式不正确的解决方法是:在使用json_encode函数时加上JSON_UNESCAPED_UNICODE参数即可,如【json_encode($arr,JSON_UNESCAPED_UNICODE)】。
问题:
使用PHP语言进行微信开发时,在创建卡券的时候出现数据格式错误,错误返回信息如下:
{“errcode”:47002,”errmsg”:”data format error, do NOT use json unicode encode (\uxxxx\uxxxx), please use utf8 encoded text! hint: [udJhFa0680e569]”}
解决办法:
使用PHP中的json_encode函数时加上参数JSON_UNESCAPED_UNICODE即可,如:
json_encode($arr,JSON_UNESCAPED_UNICODE)
以上就是微信开发中json格式不正确怎么办的详细内容,更多请关注其它相关文章!