Jump to content

Archived

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

hostfreak

Easy question?

Recommended Posts

I am sure there is an easy answer to this, but it's something I have never needed to do/think about. I've made a simple news script to post small updates etc. I store the posted news in a text field in a database. So my problem is that when I am typing the news, say I hit enter a couple times to go down a couple lines or what not. When I echo the news from the field (news) everything is put together. The lines I entered are no longer there. Is there any way to enter the lines into the database?

Share this post


Link to post
Share on other sites
Not sensibly.  The solution is to use the nl2br() function when outputting the information:

[code]echo nl2br($news_item);[/code]

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.