WordPress at a glance

backslashit() WP 1.0

Adds backslashes before letters and before a number at the start of a string.

No Hooks.

Return

String. String with backslashes inserted.

Usage

backslashit( $string );
$string(string) (required)
Value to which backslashes will be added.

Code of backslashit: wp-includes/formatting.php WP 5.2.2

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

Related Functions

From category: Formatting

No comments
    Hello, !     Log In . Register