php 中 json_decode 解析返回结果为 null 解决办法

今天在做授权登录时保存返回的数据时使用 json_encode 函数保存数据,但是当使用json_decode 函数解析时,返回 null。接着baidu。找了一部分资料。 原因是: json_decode要求的字符串比较严格:  1. 使用UTF-8编码  2. 不能在最后元素有逗号  3. 不能使用单引号  4. 不能有\r,\t,如果有请替换 使用    echo  json_last_er
相关文章
相关标签/搜索