leachus2002 Posted January 11, 2011 Share Posted January 11, 2011 Hi There, In some of my forms, I am using <textarea> boxes in order for lot's of information to be entered. When submitted, these forms pump data into a database. Is there any way of carrying through the carriage returns with the form? So that when it is displayed back on the page, it looks exactly how it was entered. For example, if someone puts the following in the text box: Hello, This is line 1 This is line 2 This is how I would like it to be displayed Thanks Matt Quote Link to comment Share on other sites More sharing options...
johnny86 Posted January 11, 2011 Share Posted January 11, 2011 You can use nl2br($string) to convert line brakes to <br> tags. You should do something like: $filtered = nl2br(htmlspecialchars($string)) change all < > signs to < and > and after that add the <br> tags. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.