note 27489 deleted from function.nl2br by aidan
| From: | aidan@php.net | Date: | Sun, 10 Oct 2004 10:38:02 +0000 |
| Subject: | note 27489 deleted from function.nl2br by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-78279@lists.php.net to get a copy of this message | ||
Note Submitter: info at spacefight dot net
----
I found the nl2br() function quite misleading since it
doesnt remove the \n, it just adds an <br />
So here's my simple code that allows redisplaying without more newlines being added:
$text = str_replace("\n", "[br]", $text); // to store the string
$text = str_replace("[br]", "\n", $text); // to retrieve it
replace the [] with <> :)
Works excellent for me!