eddorey2k3 Posted May 26, 2006 Share Posted May 26, 2006 Hey,Ok. So i've coded myself a nice little script to update the news section of my website. Works like a charm. However, the text area that you input the actual content of the news isn't all that smart (As you'd expect, it's just a text area), so all formatting has to be entered manually (Paragraphs, breaks, etc etc). What I'm trying to do, is now that the news panel is finished, is find a way of making it so any breaks in the content get auto formatted into the MySQL string that will get input into the database.I hope that makes sense, but as an example, if I were to do:[code]Todays news isThat I like cheese.[/code]At the moment, it would come out as "Todays news is That I like cheese." For this reason, I'd need to put the suitable <br>'s in. What I want, is something to recognise it's on 2 lines, and auto insert the <br>'s and <p>.Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/10542-coding-own-wysiwyg-newsadmin-panel/ Share on other sites More sharing options...
poirot Posted May 26, 2006 Share Posted May 26, 2006 For new lines, you can use nl2br()[a href=\"http://www.php.net/nl2br\" target=\"_blank\"]http://www.php.net/nl2br[/a] Quote Link to comment https://forums.phpfreaks.com/topic/10542-coding-own-wysiwyg-newsadmin-panel/#findComment-39321 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.