Hey.
Textareas take their data as
plain-text, in which line breaks are represented as a combination of the "\r" and "\n" characters. - HTML, on the other hand, does not recognize the
plain-text line breaks. It uses the
<br> tag as line-breaks (
<br /> in XHTML).
Which means that when you want to print
plain-text data (such as the text from a textarea) into HTML, you need to convert the
plain-text line-breaks to HTML line breaks.
Like with most common tasks, PHP has a function that does this for you: the
nl2br() function. See the
manual entry for more details.