Mutley Posted April 3, 2007 Share Posted April 3, 2007 In a text form how do I get it to insert <br /> style line breaks when it enters it in the database? Link to comment https://forums.phpfreaks.com/topic/45432-inserting-line-breaks-in-text-fields/ Share on other sites More sharing options...
Mutley Posted April 3, 2007 Author Share Posted April 3, 2007 I forgot to add, I know it's nl2br($text) but I'm using htmlentities So it displays it as <br /> and not actual spaces. Link to comment https://forums.phpfreaks.com/topic/45432-inserting-line-breaks-in-text-fields/#findComment-220604 Share on other sites More sharing options...
Barand Posted April 3, 2007 Share Posted April 3, 2007 Store the \n to the database, not the br tags. Use nl2br() when outputting that text in the body of an HTML document. Link to comment https://forums.phpfreaks.com/topic/45432-inserting-line-breaks-in-text-fields/#findComment-220681 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.