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 185 views
1 answer 207 views
1 answer 179 views
1 answer 175 views
175 views asked Aug 19, 2020 by avibootz
1 answer 175 views
...