函数原型
backslashit( string $string ): string
函数描述
Adds backslashes before letters and before a number at the start of a string.
是否弃用
未弃用
函数参数
-
$string
string
Required - Value to which backslashes will be added.
函数返回值
string String with backslashes inserted.
函数位置
File: wp-includes/formatting.php.
函数源码
function backslashit( $string ) {
if ( isset( $string[0] ) && $string[0] >= '0' && $string[0] <= '9' ) {
$string = '\\\\' . $string;
}
return addcslashes( $string, 'A..Za..z' );
}
源码链接
变更日志
| Version | Description |
|---|---|
| 0.71 | Introduced. |

