问题处理:php json_decode函数处理的字符串中含有反斜杠“”时,处理出错,返回的结果为NULL

php json_decode函数处理的字符串中含有反斜杠“”时,处理出错,返回的结果为NULL。

处理方法,将字符串中的反斜杠1个替换成2个:

                /**
                 * 一个反斜杠要替换成4个,否则json_decode不能解析
                 */
                $json_str = str_replace('\','\\',$json_str);
                $json = json_decode($json_str,true);
原文地址:https://www.cnblogs.com/ayao/p/json_decode.html