new line function
| From: | Tonny Robertus | Date: | Thu, 02 Sep 2004 04:28:52 +0000 |
| Subject: | new line function | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-195507@lists.php.net to get a copy of this message | ||
hi,
is there any function to replace \n to <br> that we can see the results in
html source code (not in preview)?
i tried nl2br, str_replace, and ereg_replace. but all of them work just in
page preview. when i looked in page source, the strings remain the same.
here i enclose strings i got in page source...
original:
this is the first line
and this is the second
this is the third
using nl2br function:
this is the first line<br \>
and this is the second<br \>
this is the third
my expectation:
this is the first line<br \>and this is the second<br \>this is the third
i need this cause i'll send this string with javascript. if i used nl2br, i
got message in javascript console like this:
Error: unterminated string literal
update("this is the first line<br \>
:-(
thanx
--
________________________
Dominus Tecum