backslashit( string $string )

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


Description Description


Parameters Parameters

$string

(string) (Required) Value to which backslashes will be added.


Top ↑

Return Return

(string) String with backslashes inserted.


Top ↑

Source Source

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' );
}

Top ↑

Changelog Changelog

Changelog
Version Description
0.71 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.