php addslashes() 函数用于在指定的字符串中添加反斜杠来转义特殊字符,例如引号、反斜杠等。这样可以防止这些特殊字符被误解为代码或其他意义。
语法: string addslashes(string $str)
参数:
返回值: 返回转义后的字符串。
示例:
$str = "I'm a student.";
echo addslashes($str);
输出结果为: I\'m a student.
上一篇:php如何去掉url中的域名
下一篇:php怎么删除一条数据
Laravel PHP 深圳智简公司。版权所有©2023-2043 LaravelPHP 粤ICP备2021048745号-3
Laravel 中文站