How to escape single quote in string with PHP

1 Answer

0 votes
$s = "php'java'c'python";

$s = addslashes($s);

echo $s;

  
     
/*
run:
          
php\'java\'c\'python
   
*/

 



answered Oct 12, 2019 by avibootz

Related questions

1 answer 183 views
1 answer 206 views
1 answer 177 views
1 answer 174 views
174 views asked Aug 19, 2020 by avibootz
1 answer 174 views
...