note 82347 deleted from function.nl2br by thiago
| From: | thiago@php.net | Date: | Thu, 05 Mar 2009 12:14:53 +0000 |
| Subject: | note 82347 deleted from function.nl2br by thiago | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-151515@lists.php.net to get a copy of this message | ||
Note Submitter: Svetoslav Marinov
----
It seems that new lines break the string in JavaScript, so if this is your case use the following
code instead nl2br
$str = preg_replace('#\r?\n#', '<br />', $str);
Slavi