hostfreak Posted September 6, 2006 Share Posted September 6, 2006 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? Link to comment https://forums.phpfreaks.com/topic/19872-easy-question/ Share on other sites More sharing options...
AndyB Posted September 6, 2006 Share Posted September 6, 2006 Not sensibly. The solution is to use the nl2br() function when outputting the information:[code]echo nl2br($news_item);[/code] Link to comment https://forums.phpfreaks.com/topic/19872-easy-question/#findComment-86944 Share on other sites More sharing options...
hostfreak Posted September 6, 2006 Author Share Posted September 6, 2006 Thanks Andy, that worked. Link to comment https://forums.phpfreaks.com/topic/19872-easy-question/#findComment-86948 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.