Re: Processing newlines in a text area field

From: Date: Fri, 14 Oct 2011 02:55:10 +0000
Subject: Re: Processing newlines in a text area field
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-315292@lists.php.net to get a copy of this message
Answer below! Jason Pruim lists@pruimphotography.com On Oct 13, 2011, at 10:49 PM, Stephen wrote: > I have a web page with a form with a text area. I enter: > > foo > > > bar > > PHP processes the POST and inserts the record into MySQL. > > The database field is text. > > I use PDO > > For testing I have removed any processing of the text area content. > > Now, no matter how many blank rows I have between foo and bar, in the database record, I always > get a single newline character. > > I am using Firefox 7.0.1. > > Is this normal behaviour? I want to be able to enter more than 1 newline. It could possibly be just not displaying it properly in the webpage... try running the output through: nl2br(); and see if that helps. > > Thanks > Stephen > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#315292) next »