note 42200 deleted from function.nl2br by tomsommer
| From: | tomsommer@php.net | Date: | Fri, 07 May 2004 18:25:24 +0000 |
| Subject: | note 42200 deleted from function.nl2br by tomsommer | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-69323@lists.php.net to get a copy of this message | ||
Note Submitter: Adrian
----
nl2br replaces \n with a <br />. Sometimes one may need to replay the \r as well that coexists
with the \n from form field sumbission.
to take this into account, put this function into your page:
function nl2br_clear($text) {
$text = ereg_replace("\r\n", "<br />", $text);
return $text;
}
and search and replace nl2br (wehere it would usually go) and replace with nl2br_clear