Re: How do I display new lines in a textearea?

From: Date: Fri, 06 Jun 2003 07:57:43 +0000
Subject: Re: How do I display new lines in a textearea?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-150457@lists.php.net to get a copy of this message
Hi Thanks, I DID use \n, BUT, I made a stupid mistake, I did: <textarea> <?php echo $word.'\n'; ?> </textarea> And the literal ' did not "parse" the \n, replacing with " works fine... On Thu, 2003-06-05 at 16:32, CPT John W. Holmes wrote: > > I want to have a textarea that contains details read from a mysql table, > > but I want to echo each row so that it is on a new line. What is the > > "new-line" character for a textarea? ( in effect the reverse of nl2br() > > A newline is \n > > $text = "word\nword\nword\n"; > > echo "<textarea>$word</textarea>"; > > will have each "word" on a different line. > > ---John Holmes...

« previous php.general (#150457) next »