backslashit()

最后更新于:2021-11-25 19:53:24

backslashit( 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.

源文件

文件: gc-includes/formatting.php

function backslashit( $string ) {
	if ( isset( $string[0] ) && $string[0] >= '0' && $string[0] <= '9' ) {
		$string = '\\' . $string;
	}
	return addcslashes( $string, 'A..Za..z' );
}