backslashit()
backslashit( string $string )
在字符串开头的字母前和数字前添加反斜杠。
Adds backslashes before letters and before a number at the start of a string.
参数(Parameters)
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
$string | (string) | 必需 | 将添加反斜杠的值。 |
返回(Return)
(string)插入反斜杠的string。
源码(Source)
/** * Adds backslashes before letters and before a number at the start of a string. * * @since 0.71 * * @param string $string Value to which backslashes will be added. * @return string String with backslashes inserted. */ function backslashit( $string ) { if ( isset( $string[0] ) && $string[0] >= '0' && $string[0] <= '9'="" )="" $string='' .="" $string;="" return="" addcslashes(="" $string,="" 'a..za..z'="" );="" }="">
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
0.71 | wp-includes/formatting.php:2668 | 0 | 0 |
backslashit() 为WP2原创文章,链接:https://www.wp2.cn/functions/backslashit/