DeX Posted December 14, 2011 Share Posted December 14, 2011 I have a text area where text is entered on a webpage, it's submitted into the database, then displayed on the next page. When it's displayed, it is pulled from the database and it's just one long string, all the returns (enter) used to separate lines are ignored. Quote Link to comment https://forums.phpfreaks.com/topic/253128-how-can-i-store-information-in-the-database-and-keep-end-of-line-characters/ Share on other sites More sharing options...
PFMaBiSmAd Posted December 14, 2011 Share Posted December 14, 2011 \n characters don't actually mean anything in displayed content (they only format the 'view source' of your page in the browser.) Use nl2br when you output content on the page to add HTML <br> tags to each \n character. Quote Link to comment https://forums.phpfreaks.com/topic/253128-how-can-i-store-information-in-the-database-and-keep-end-of-line-characters/#findComment-1297704 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.