Revision: 8059
Updated Code
at August 31, 2008 22:09 by section31
Updated Code
/* // example usage <script type="text/javascript"> var str = '<?= to_js_string($html) ?>'; </script> */ function to_js_string($str) { return str_replace(array("\\", "'", "\r", "\n"), array('\\\\', "\'", ' ', ' '), $str); }
Revision: 8058
Updated Code
at August 31, 2008 22:08 by section31
Updated Code
/* // example usage <script type="text/javascript"> var str = '<?= to_js_string($html) ?>'; </script> */ function to_js_string($str) { return str_replace(array("\\", "'", "\r", "\n"), array('\\\\', "\'", ' ', ' '), $str); }
Revision: 8057
Updated Code
at August 31, 2008 22:04 by section31
Updated Code
function to_js_string($str) { return str_replace(array("\\", "'", "\r", "\n"), array('\\\\', "\'", ' ', ' '), $str); }
Revision: 8056
Updated Code
at August 31, 2008 22:04 by section31
Updated Code
function to_js_string($str) { return str_replace(array("\\", "'", "\r", "\n"), array('\\\\', "\'", ' ', ' '), $str); }
Revision: 8055
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at August 31, 2008 21:56 by section31
Initial Code
function to_js_string($str) { return str_replace(array("'", "\r", "\n", "\\"), array("\'", ' ', ' ', "\\\\"), $str); }
Initial URL
Initial Description
Initial Title
To Javascript String
Initial Tags
Initial Language
PHP