Why aren't my line breaks from the form showing when I display data from the database

Tagged:  

Why aren't my line breaks from the form showing when I display data from the database?
 
I ran into this a year ago, when i was building my first community site in php from the ground up. I formatted the data to look ok in the form, but when i fetched the data from the database and echoed it on the page, all the line breaks were gone. It looked horribly. In phpmyadmin it looked good thou.
After a little digging around i found out that the line break's were stored as \n which doesn't make the browser do anything. The way to fix this is to use a nice function php has, nl2br(). nl2br( string $string [, bool $is_xhtml ] ) Returns string with '<br />' or '<br>' inserted before all newlines. The form formatting was back on the page, problem solved.