I've got a DB entry with a varchar field with the following text saved:
This is a line
new line here
and another line here
I can only see those line breaks if I print it within textarea. How can I make the line break work outside of textarea?
A sequence of multiple white space characters is collapsed by default in
HTML, except in some elements like textarea inner text like you
noticed. You have a few options:
<br> tags (see nl2br())<pre>white-space of your element to pre, pre-line
or pre-wrap which will respect line breaks