how to add slash in string code example
Example 1: add slashes to string
str = str.replace(/'/g, "\\'");
Example 2: add slashes to string
<?php
$str = "O'Reilly?";
eval("echo '" . addslashes($str) . "';");
?>
str = str.replace(/'/g, "\\'");
<?php
$str = "O'Reilly?";
eval("echo '" . addslashes($str) . "';");
?>