backslashit( string $value ): string

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


Parameters

$value string Required
Value to which backslashes will be added.

Top ↑

Return

string String with backslashes inserted.


Top ↑

Source

File: wp-includes/formatting.php. View all references

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

Top ↑

Changelog

Changelog
Version Description
0.71 Introduced.

Top ↑

User Contributed Notes

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