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/
posted @ 2013-05-23 19:06  xujif  阅读(374)  评论(0编辑  收藏  举报