|
Posted by Rik on 04/29/06 01:52
Geoff Berrow wrote:
> Message-ID: <e2u3ak$8om$1@netlx020.civ.utwente.nl> from Rik contained
> the following:
>
>> Else: don't use nl2br() while displaying it in a textarea.
>
> AFAIK nl2br() adds a <br /> butt 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
Navigation:
[Reply to this message]
|