note 9012 deleted from function.strtr by felipe
| From: | felipe@php.net | Date: | Sat, 29 Dec 2007 18:50:54 +0000 |
| Subject: | note 9012 deleted from function.strtr by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-134173@lists.php.net to get a copy of this message | ||
Note Submitter: herve at milk dot fr
----
strtr() is useful when trying to convert a string from PHP to Javascript (as JS doesn't allow
linebreaks in string declarations) :
<script language="Javascript">
<?php
print("var js_string = \"%s\";",strtr($php_string,"\n\r\t\0","
");
?>