PHP addslashes() and stripslashes() Functions

addslashes(string) — This PHP function returns a string with backslashes in front of each character that needs to be quoted in a database query. This characters that will have the backslash (\) placed in front of it are: single quote ('), double quote ("), backslash (\) and NULL (the NULL byte).

stripslashes(string) — This PHP function returns a string with the backslashes (\) removed that were added by the PHP addslashes() function.

Try it here. Enter your string below to calculate its result:
e.g. An input of 'I'm Mr. O'Connor.' will produce 'I\'m Mr. O\'Connor.' for addslashes()
and an input of 'I\'m Mr. O\'Connor.' will produce 'I'm Mr. O'Connor.' for stripslashes().
Choose a function:

Function Results
Test String:
addslashes() Resulting String:
stripslashes() Resulting String: