Re: Convert textarea post data from plain text to html using php..how?
| From: | John Holmes | Date: | Mon, 13 Sep 2004 19:35:22 +0000 |
| Subject: | Re: Convert textarea post data from plain text to html using php..how? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-196560@lists.php.net to get a copy of this message | ||
From: "M. Sokolewicz" <tularis@php.net>
It doesn't change anything, actually. It just inserts the <br />. <?php $str = "asdf\nasdf\nasdf\nasdf"; $n = nl2br($str); if(strstr($n,"\n")) { echo 'Newlines present'; } else { echo 'Newlines not present'; } ?> ---John Holmes...1. nl2br($posteddata) - This converts all the \r\n's to <br>'s so that it comes out with the same carriage returns as the person who inputed it gave itIt doesn't change \r\n to <br>, it only changes \n to <br />