Menu Close

addcslashes() function PHP

Codeamend

addcslashes() function returns a string with backslashes.

Syntax

addcslashes(string,characters) 

Parameter Values

string : Defines the string to be escaped.

characters : Defines the characters or range of characters to be escaped.

Technical Details

Return Value : Returns the escaped string.

PHP Version : 4+

Examples

<?php $string = addcslashes("Codeamend Team","e");
echo($string); 
?>

Output : Cod\eam\end T\eam 

Note

The addcslashes() function is case-sensitive.

Be careful using addcslashes() on 0 (NULL), r (carriage return), n (newline), f (form feed), t (tab) and v (vertical tab). In PHP, \0, \r, \n, \t, \f and \v are predefined escape sequences.

Posted in PHP

You can also read...