Posted by bonfils on 07/24/05 11:34
"meltedown" <groups2@reenie.org> skrev i en meddelelse
news:oJzEe.562187$iM6.132152@fe01.news.easynews.com...
>I have a textarea in a form. When the value is added to a database, the
>linebreaks are lost. How can I preserve them ?
Depends on what you mean by "lost". The "linebreaks" you see in a textarea
are in fact newline characters (\n) and are saved as such in the database.
And newline characters are usually ignored in HTML.
But - you can convert them with nl2br():
http://dk2.php.net/manual/en/function.nl2br.php
Hope this helps.
--
bonfils
http://kim.bonfils.com
Navigation:
[Reply to this message]
|