Yes, for the linebreaks to be perserved in an (X)HTML document, you will need to replace newline characters with <br> (or you can keep the newline characters, your choice). Often, though, I find that users most often go to a new line at the end of a paragraph, so I prefer wrapping text in <p> tags.
The simple way is with the nl2br() Keep in mind, though, that this will output the <br /> tag. So, if you are using HTML, this is not desirable. So, one can use:
str_replace(chr(13), '<br>', $text)
Or, if you want to wrap the text in <p> tags, which might be a bit more semantic:
PHP Code:
$text='<p>'.$text.'</p>';
$text=str_replace(chr(13).chr(10), "</p>\n<p>", $text);
$text=str_replace(chr(10).'<p></p>', '', $text);
Bookmarks