note 15422 added to function.nl2br
| From: | mmc at nospam dot dk | Date: | Sun, 09 Sep 2001 23:35:41 +0000 |
| Subject: | note 15422 added to function.nl2br | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-17855@lists.php.net to get a copy of this message | ||
Hmm, seems that this page can't doesn't convert tags - how ironnic! :)
Anyway, just to be a bit constructive ;)
here's a (system independent) way to replace linebreaks with html-linebreaks:
$text = ereg_replace("(\r?\n|\r)", "<br>", $text);
(the second argument should be <br%gt; in case it doesn't show right).
If you want the old effect of nl2br(), just insert "\n" after the br-tag...
http://www.php.net/manual/en/function.nl2br.php