Re: Line Breaks in a Textarea
- From: "Rik" <luiheidsgoeroe@xxxxxxxxxxx>
- Date: Sat, 29 Apr 2006 00:52:24 +0200
Geoff Berrow wrote:
Message-ID: <e2u3ak$8om$1@xxxxxxxxxxxxxxxxxxxxxxx> from Rik contained
the following:
Else: don't use nl2br() while displaying it in a textarea.
AFAIK nl2br() adds a <br /> *** doesn't remove the \n
Yup, but in shows "<br />" in the textarea, so you get line-breaks, and on
every end a useless <br />.
Which would you prefer:
<?php
$string="aksfdjal\nsgfhsflijslfj\nsdihflsjfldsf";
?>
<textarea><?php echo nl2br($string); ?></textarea>
<textarea><?php echo $string; ?></textarea>
Grtz,
--
Rik Wasmus
.
- References:
- Line Breaks in a Textarea
- From: joelbyrd
- Re: Line Breaks in a Textarea
- From: Rik
- Re: Line Breaks in a Textarea
- From: Geoff Berrow
- Line Breaks in a Textarea
- Prev by Date: Re: MySQL Speed
- Next by Date: Re: Looking for general advice on security
- Previous by thread: Re: Line Breaks in a Textarea
- Next by thread: Re: Line Breaks in a Textarea
- Index(es):