spikypunker Posted January 18, 2009 Share Posted January 18, 2009 Hey guys Am developing a user small scale user community, have asked a few questions for it so far, and it's going real well. I'm not very advanced with my PHP and have had this problem in the past but have just lived with it before but now i really wanna sort it out. When someone makes a profile they can put in thier details, most being single lines. However there is an About Me box where they invariably end up putting in some parabreaks. When this goes into the database they are still present but obviously when its read back into a page it ignores the returns so i get a chunk of text. I'm not 100% but it used to be a simple case of putting the text inside a <p> tag which used to keep the formatting but it's changed now. Is there a simple way to achieve this? Peace Quote Link to comment https://forums.phpfreaks.com/topic/141334-solved-how-to-format-a-chunk-of-user-inputted-text/ Share on other sites More sharing options...
Daniel0 Posted January 18, 2009 Share Posted January 18, 2009 You can use nl2br to make regular line breaks into HTML line breaks. Quote Link to comment https://forums.phpfreaks.com/topic/141334-solved-how-to-format-a-chunk-of-user-inputted-text/#findComment-739735 Share on other sites More sharing options...
spikypunker Posted January 18, 2009 Author Share Posted January 18, 2009 Holy moly! Thats awesome! Cheers dude! Quote Link to comment https://forums.phpfreaks.com/topic/141334-solved-how-to-format-a-chunk-of-user-inputted-text/#findComment-739746 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.