The most recent day map is GIS integration · To output HTML into JavaScript · It's more troublesome to involve code escaping what? · So write a function of PHP
Share:
function Jsformat ($str)
{
$str = trim ($STR);
$str = Str_replace (' \\s\\s ', ' \\s ', $str);
$STR = Str_replace (CHR), ", $str);
$STR = Str_replace (Chr, ", $str);
$str = Str_replace (' , ', $str);
$str = str_replace (' \ \ ', ' \\\\ ', $str);
$str = Str_replace (' ", ' \ \ \", $str);
$str = Str_replace (' \\\ ', ' \\\\\ ', $str);
$str = Str_replace ("'", "\"), $str);
return $str;
}
Use is needless to say. is to call Jsformat directly ($STR)
The above is the entire contents of this article, I hope to be able to understand the PHP escape to JavaScript Help
Please take a moment to share the article with your friends or leave a comment. We will sincerely thank you for your support!