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






