单引号被转义为 '
双引号被转义为 "
那么可以进行如下设置以防止:
方法一:在PHP.ini中设置:magic_quotes_gpc = Off
方法二: $str=stripcslashes($str)