在php.ini文件中magic_quotes_gpc = on ---- 一般情况下是on,怕用户忘记转义某些特殊字符。
因此,要判断当前php的配置要取得我们想要的内容。
$gpc=get_magic_quotes_gpc(); ----返回1,magic_quotes_gpc = on,0为off
if ($gpc==1){
$json=stripcslashes($_POST['str']); ----stripcslashes() 函数删除由 addcslashes() 函数添加的反斜杠
}else{
$json=$_POST['strjson'];
}