Menu Close

addcslashes() function PHP

4.6
(14)

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.

How useful was this post?

Click on a star to rate it!

Average rating 4.6 / 5. Vote count: 14

No votes so far! Be the first to rate this post.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Share

Posted in PHP

Leave a Reply

Your email address will not be published. Required fields are marked *

You can also read...