addcslashes()

It  returns a string with backslashes in front of the specified characters

Example

<?php
echo addcslashes(‘php{[^’, ‘A..z’);
?>

Output

php{[^

Share