stripcslashes() converts C-style escape sequences (\, \a, \b, \f, \n, \r, \t, \v, and \x hh hex and \ ooo octal character escape sequences) to their literal equivalents. Additionally, it strips the backslash from escape sequences that it doesn’t recognize. You can specify ranges of characters by separating them by two periods; for example, to un-escape characters between a and q, use “a..q”. Multiple characters and ranges can be specified in characters. The stripcslashes() function is the inverse of addcslashes().
stripcslashes(string $string): string
To remove backslashes without performing conversions:
To add escape sequences to a string:
|string||The string to be unescaped.|
Returns the unescaped string.
<?php var_dump(stripcslashes('I\'d have a coffee.\nNot a problem.') === "I'd have a coffee. Not a problem."); // true ?>
The addcslashes function returns the text argument after escaping characters in the style of the C programming language. Briefly, this means special characters are replaced with codes, such as \n replacing a newline character, and other characters outside ASCII 32-126 are replaced with backslash octal codes.