note 39503 deleted from function.addcslashes by tomsommer
| From: | tomsommer@php.net | Date: | Fri, 30 Jan 2004 19:49:48 +0000 |
| Subject: | note 39503 deleted from function.addcslashes by tomsommer | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-64455@lists.php.net to get a copy of this message | ||
Note Submitter: Emile Schenk
----
This is easier done this way:
$out="some string with special chars";
$out=nl2br(htmlspecialchars(addslashes($out)));
$out=str_replace("\n",' ',$out);
$out=str_replace("\r",' ',$out);
print "<script>a='$out';
window.open('javascript:document.write(opener.a)');</script>";