guestabc Posted December 23, 2008 Share Posted December 23, 2008 Hi i am currently trying to create an area where a user can upload their own blog. I currently have a form and this allows the user to input html code such as line breaks. which is what i want because i want the user to be able to embed images and object etc. however i want the user to be able to just press the return key instead of having to use line break tags or new paragraph tags. I've tried looking around google and this site but not found anything useful as of yet. thanks Link to comment https://forums.phpfreaks.com/topic/138243-reading-and-storing-line-breaks/ Share on other sites More sharing options...
Goldeneye Posted December 23, 2008 Share Posted December 23, 2008 I believe you'll want to use nl2br() for that Link to comment https://forums.phpfreaks.com/topic/138243-reading-and-storing-line-breaks/#findComment-722782 Share on other sites More sharing options...
ngreenwood6 Posted December 23, 2008 Share Posted December 23, 2008 you beat me to it. pass the data through with the nl2br() and it will insert the line breaks in the database(but you cant see them) Link to comment https://forums.phpfreaks.com/topic/138243-reading-and-storing-line-breaks/#findComment-722783 Share on other sites More sharing options...
Goldeneye Posted December 23, 2008 Share Posted December 23, 2008 To add on to what ngreenwood6 said, assuming you're formatting text, it's better to format when you retrieve it from the database, not when you're inserting it into the database. Link to comment https://forums.phpfreaks.com/topic/138243-reading-and-storing-line-breaks/#findComment-722784 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.