Menu Close

addcslashes() function PHP


addcslashes() function returns a string with backslashes.



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+


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

Output : Cod\eam\end T\eam 


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: 15

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?


Posted in PHP

Leave a Reply

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

You can also read...