在php中,可以利用stripslashes()函数来去掉字符串中的反斜杠。 
stripslashes() 函数可返回一个剥离了转义反斜线后的字符串。 
<!--?php 
header("Content-type:text/html;charset=utf-8"); 
$str = "欢迎来到\'老罗博客\'"; 
$newstr = stripslashes($str); 
echo $str."<br-->"; 
echo $newstr; 
?> 
说明: 
stripslashes() 函数删除由 addslashes() 函数添加的反斜杠。(addslashes() 函数的作用是给字符串加入\,对指定的字符串进行转义) 
存数据库一般要用addslashes来过滤下内容 
          
                    
                  上一篇                     
               
			  
 
			 
			 
			 
			 
			 
			 
			