kstyrvoll Posted January 11, 2007 Share Posted January 11, 2007 Please excuse me for this question, but ..I have made a blog, everything is working as expected exept displaying of articles I have posted.When I make a new article, I use carriage return(enter) and format the article into several sections:Example:-startThis is a little problem.Please help.-endBut when I displays the article on my blog, it is "densed" together:-startThis is a little problem. Please help.-endWhen I open the article for editing, the formatting is correct.Sorry for not posting any code, but I don't have access to my pc or my isp from where I'm sitting right now.Thanks in advance.Kristian Quote Link to comment Share on other sites More sharing options...
lucasl Posted January 11, 2007 Share Posted January 11, 2007 Sounds like you aren't putting "\n" between sections.EG.[code=php:0]//Instead of:<$phpecho "$section1$section2";?>Consider:<$phpecho "$section1\n$section2";?> Quote Link to comment Share on other sites More sharing options...
chronister Posted January 11, 2007 Share Posted January 11, 2007 nl2br($_POST['your text field']);This is new line 2 break. It will automatically insert a <br> tag into the date wherever it finds a new line.nate Quote Link to comment Share on other sites More sharing options...
chronister Posted January 11, 2007 Share Posted January 11, 2007 [quote]nl2br($_POST['your text field']);This is new line 2 break. It will automatically insert a[code] <br /> [/code]tag into the date wherever it finds a new line (carriage return).nate[/quote]They have cut down the modify time, so I could not fix a couple things I wanted.You then would reverse it with a [code]str_replace('<br />', '\n', $your_text_var_name)[/code] Quote Link to comment Share on other sites More sharing options...
kstyrvoll Posted January 11, 2007 Author Share Posted January 11, 2007 thanks!!nl2br(... did it. Quote Link to comment 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.