php对post数据进行json_decode返回null

js对数据进行json话后,直接post给php,但是php进行json_decode之后返回null,单引号什么都是正常的。

最后,发现是转义的问题,所以:

 
 if (get_magic_quotes_gpc()){
            $t = stripslashes($t);
        }


文章来源:http://blog.xujif.com/archives/php-js-json-post-json_decode-null/

作者:i@xujif.com

欢迎访问浊酒的博客

欢迎转载,但请注明出处

原文地址:https://www.cnblogs.com/xujif/p/3095394.html