Re: Convert textarea post data from plain text to html using php..how?

From: Date: Mon, 13 Sep 2004 18:27:23 +0000
Subject: Re: Convert textarea post data from plain text to html using php..how?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-196546@lists.php.net to get a copy of this message
Trevor Gryffyn wrote:
Two options: 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 it It doesn't change \r\n to <br>, it only changes \n to <br />
2. Use HTML "<pre>" tabs to do the same thing. I think that's the trickiest thing about using textarea to input then regurgitate the data. Everything else should come out pretty much the same. -TG
-----Original Message----- From: Brent Clements [mailto:bclem@imaginative-enterprises.com] Sent: Saturday, September 11, 2004 7:02 PM To: php-general@lists.php.net Subject: [PHP] Convert textarea post data from plain text to html using php..how? Do you guys happen to have an easy easy to do this? I need to convert plain text submitted via a textarea form field to html formatted text. Is there a way to do this with php? Thanks, Brent


« previous php.general (#196546) next »