note 9012 deleted from function.strtr by felipe

[email protected]
Newsgroups php.notes
Message-ID <[email protected]>
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","    ");
?>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.