Jump to content

Archived

This topic is now archived and is closed to further replies.

eddorey2k3

Coding own WYSIWYG news/admin panel.

Recommended Posts

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 is
That 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?

Share this post


Link to post
Share on other sites
For new lines, you can use nl2br()
[a href=\"http://www.php.net/nl2br\" target=\"_blank\"]http://www.php.net/nl2br[/a]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.