$results = json_decode($contents, true);返回null如何解决,看了微信那边返回的是utf-8字符编码的json,但是json_decode()返回error_code:4, error_msg:Syntax error;其实是一些看不见的字符,总不能每次把看不见的字符搂出来,一个个preg_replace()了,有没有通用的方法呢?网上搜了很多答案都解决不了。
大家讲道理2017-04-10 17:01:20
results = json_decode($contents, true);
把$content 打印到一个log文件里 对比下 试试把日志的内容直接json_decode