Page 1 of 1

Forum Post New Line

Posted: Sat Feb 19, 2011 8:26 am
by lenton
I'm currently making my own forum in PHP.

I have this in my database:
Image

But when I echo it on my forum it doesn't show the new lines:
Image

How do I get the post to echo the same as what's in the database (with the line breaks). Thanks for your help!

Re: Forum Post New Line

Posted: Sat Feb 19, 2011 9:07 am
by Darhazer
use nl2br() ;) This will replace new lines with <br/> tags which is the way to display a new line in HTML page

Re: Forum Post New Line

Posted: Sat Feb 19, 2011 9:29 am
by lenton
THANKS!

Re: Forum Post New Line

Posted: Sun Feb 20, 2011 7:27 am
by ganesh_dabhade
You have to use nl2br() function.