Jump to content

Trying to make a blog ..


kstyrvoll

Recommended Posts

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:
-start
This is a little problem.

Please help.
-end

But when I displays the article on my blog, it is "densed" together:
-start
This is a little problem. Please help.
-end

When 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
Link to comment
https://forums.phpfreaks.com/topic/33706-trying-to-make-a-blog/
Share on other sites

[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]
Link to comment
https://forums.phpfreaks.com/topic/33706-trying-to-make-a-blog/#findComment-158068
Share on other sites

Archived

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

×
×
  • Create New...

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.