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.
Changelog
Since 0.71 | Introduced. |
Code of backslashit() backslashit WP 5.6
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
- absint()
- add_magic_quotes()
- antispambot()
- balanceTags()
- capital_P_dangit()
- convert_smilies()
- ent2ncr()
- force_balance_tags()
- links_add_target()