Page 1 of 1

Converting Line Breaks

Posted: Sun Dec 01, 2002 10:53 pm
by thoughtriot
I'm using MySQL to make a little news blog. I have a field called Entry, and it's a text field. I was wondering if when I hit the Return key 2 times to make a space in between paragraphs, how I could make that line visible on the page where I display the news entries. Because other people update the news, and they don't know that you need to put <br>s in to make line breaks, so they use the return key, and then the breaks don't show up when the entries are displayed. How do I convert blank lines to <br>s so they show up in my php page?

Posted: Sun Dec 01, 2002 11:46 pm
by volka
http://www.php.net/manual/en/function.nl2br.php
Description
string nl2br ( string string)
Returns string with '<br />' inserted before all newlines.