添加斜杠以转义字符串。
原型
addslashes_gpc( string $gpc )
描述
如果设置了magic_quotes_gpc,将首先删除斜杠,有关详细信息,请参阅https://secure.php.net/magic_quotes。
参数
$gpc
(string)
(Required)
从HTTP请求数据返回的字符串。
返回值
(string)
返回使用斜杠转义的字符串。
源文件
路径:wp-includes/formatting.php
<?php
...
function addslashes_gpc($gpc) {
if ( get_magic_quotes_gpc() )
$gpc = stripslashes($gpc);
return wp_slash($gpc);
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/addslashes_gpc/