PHP addslashes() Function

PHP addslashes() function is used to add backslashes before the characters that need to be escaped. These characters are single quote ('), double quote ("), backslash (\) and NUL (the NULL byte).

Syntax

addslashes() Function Parameter

ParameterDescription
str :Required parameter. The string to be escaped.

addslashes() Function Return Value

Return Value :Returns the escaped string.

addslashes() Function Example