Page 1 of 1

Line Breaks

Posted: Mon May 05, 2003 10:46 am
by Cookie-Monster
I have a problem with the breaking of the lines. I hope that it is called like this in english. I do not mean word wrap but the pressing of Return.

A tried to implement phpBB into my website. and therefore wnated announcements of the board as news on my page. I managed to do that. Wasn't so difficult.

But please feel free to have a look at my problem. The news section is here: http://www.starfall.de

The post on the board is here: http://board.starfall.de/viewtopic.php?t=285

And I want the news to look exactly like the topic, but as you can see it doesn't and I do not have the slightest idea why.

Could you help me?

thx Cookie

Posted: Mon May 05, 2003 11:00 am
by JPlush76

Posted: Tue May 06, 2003 8:18 am
by Cookie-Monster
That was a good idea. I also discovered another method of doing it:

$message = str_replace("\n", "\n<br />\n", $message);

Wonder why I didn't do it like this in the first way.

Posted: Tue May 06, 2003 9:22 am
by twigletmac
Cookie-Monster wrote:That was a good idea. I also discovered another method of doing it:

$message = str_replace("\n", "\n<br />\n", $message);

Wonder why I didn't do it like this in the first way.
It's probably preferable to use nl2br() as it does exactly what the str_replace() snippet you posted above does.

Mac