PHP addcslashes() Function

PHP addcslashes() function is used to add backslashes before the specified characters.

Syntax

addcslashes() Function Parameter

ParameterDescription
str :Required parameter. The string to be escaped.
charlist :Required parameter. A list of characters to be escaped.

addcslashes() Function Return Value

Return Value :Returns the escaped string.

addcslashes() Function Example 1

addcslashes() Function Example 2

addcslashes() Function Example 3