How to use addcslashes() function to add to string backslashes before characters that listed in charlist in PHP

3 Answers

0 votes
echo addcslashes('abc', 'A..z');

   
/*
run: 

\a\b\c 

*/

 



answered May 15, 2016 by avibootz
0 votes
echo addcslashes('[ ]', 'A..z'); // small z

   
/*
run: 

\[ \] 

*/

 



answered May 15, 2016 by avibootz
0 votes
echo addcslashes('[ ]', 'A..Z'); // big z

   
/*
run: 

[ ] 

*/

 



answered May 15, 2016 by avibootz

Related questions

4 answers 377 views
1 answer 197 views
1 answer 135 views
1 answer 146 views
1 answer 215 views
...