note 92495 modified in function.addcslashes by danbrown
| From: | danbrown@php.net | Date: | Mon, 27 Jul 2009 14:49:42 +0000 |
| Subject: | note 92495 modified in function.addcslashes by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-158774@lists.php.net to get a copy of this message | ||
Perhaps the following is a more efficient JavaScript escape function:
<?php
function jsEscape($str) {
return addcslashes($str,"\\\'\"&\n\r<>");
}
?>
--was--
Perhaps the following is a more efficient JavaScript escape function:
function jsEscape($str) {
return addcslashes($str,"\\\'\"&\n\r<>");
}
http://php.net/manual/en/function.addcslashes.php