Re: textarea new line

From: Date: Fri, 24 Jan 2003 02:00:51 +0000
Subject: Re: textarea new line
References: 1 2  Groups: php.general php.general 
Request: Send a blank email to php-general+get-132934@lists.php.net to get a copy of this message
u can use nl2br() to convert \n to <br> tags b4 echo the string in textarea. Foong "Neil M" <neil.mooney@cern.ch> wrote in message news:3E2FD832.8060601@cern.ch... > Adi wrote: > > i want to add in textarea a string with new line tag in it. how to do that? > > > > my try: > > $string="-line1n\ -line2 n\-line3"; > > echo "<br><textarea name='aria' cols='50' > > rows='2'>$string</textarea>"; > > > > but i see a single line instead of: > > -line1 > > -line2 > > -line3 > > > > tx in advance for any help > > > > Hello > > For a new line in a text area you cant use html <br>'s > > You need to use either \n OR \r\n > > Thanks > > Neil >

« previous php.general (#132934) next »