grippat Posted January 23, 2008 Report Share Posted January 23, 2008 I have a form which contains a <textarea> element where people are supposed to type several paragraphs. I then use PHP to save this element's contents to a MySQL database. When I use PHP to display the textarea's contents from the database on another page the line breaks have all been removed. Is there a way I can tell PHP or MySQL to preserve the line breaks so the text is in paragraphs? Link to comment Share on other sites More sharing options...
grippat Posted January 23, 2008 Author Report Share Posted January 23, 2008 Nevermind, just found the answer myself: the nl2br() function Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now