note 9012 modified in function.strtr by irchtml
| From: | irchtml@php.net | Date: | Tue, 24 Feb 2004 09:04:46 +0000 |
| Subject: | note 9012 modified in function.strtr by irchtml | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-65637@lists.php.net to get a copy of this message | ||
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","
");
?>
--was--
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","
");
?>
http://www.php.net/manual/en/function.strtr.php