jonaHill87 Posted June 10, 2008 Share Posted June 10, 2008 Hi all. I have a question about text that is input from a user into a form and then placed in a database field. I'm creating a small forum and I'm looking for a solution for displaying the input text the way it was typed into the form. For example if a user hits the enter key to create a new paragraph. When I pull the text out of the database and then display it using echo, the text is all in one line. I hope that made sense. I'm using a TEXT field in my database table. Any help would be greatly appreciated. Link to comment https://forums.phpfreaks.com/topic/109652-formatting-text-from-database/ Share on other sites More sharing options...
DarkWater Posted June 10, 2008 Share Posted June 10, 2008 Use nl2br() on the text before inserting it into the DB. Link to comment https://forums.phpfreaks.com/topic/109652-formatting-text-from-database/#findComment-562581 Share on other sites More sharing options...
jonaHill87 Posted June 10, 2008 Author Share Posted June 10, 2008 ok thanks I'll give it a try Link to comment https://forums.phpfreaks.com/topic/109652-formatting-text-from-database/#findComment-562624 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.