PHP addcslashes() function is used to add backslashes before the specified characters.
Syntax
string addcslashes(str,charlist);
Parameter | Description |
---|---|
str : | Required parameter. The string to be escaped. |
charlist : | Required parameter. A list of characters to be escaped. |
Return Value : | Returns the escaped string. |
<?php echo(addcslashes("Returns the escaped string","t")); ?>
<?php echo(addcslashes("Returns the escaped string",'A..Z')); ?>
<?php echo(addcslashes("Returns the escaped string",'a..z')); ?>