mySql -> php -> page; a formatting question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
intellivision
Forum Commoner
Posts: 83
Joined: Mon Aug 22, 2005 1:25 am
Location: Orbit

mySql -> php -> page; a formatting question

Post by intellivision »

I'm pulling some text out of a mySql table and putting it on a page. Here's the source when I View Source in my browser:

Code: Select all

I've owned this for almost 6 months now, and I can say it's mediocre to fairly good in every respect except sound: it's really damn good at producing music, given its size.

In fact, the sound will surprise most people. It's that good. Of course, everything is relative, and  my rating of the sound of the On Tour takes into account its sheer portability.

In a 15' x 15' room with a cocktail party (I tried) it's not going to cut it as the music source.
But on the page it runs together like this:
I've owned this for almost 6 months now, and I can say it's mediocre to fairly good in every respect except sound: it's really damn good at producing music, given its size. In fact, the sound will surprise most people. It's that good. Of course, everything is relative, and my rating of the sound of the On Tour takes into account its sheer portability. In a 15' x 15' room with a cocktail party (I tried) it's not going to cut it as the music source.
Question: how can I get it to retain the breaks?
sticksys
Forum Commoner
Posts: 33
Joined: Thu Aug 18, 2005 3:23 am
Location: Isreal
Contact:

Post by sticksys »

Code: Select all

<?
echo nl2br("$MsyBody");
?>
=]
User avatar
vigge89
Forum Regular
Posts: 875
Joined: Wed Jul 30, 2003 3:29 am
Location: Sweden

Post by vigge89 »

sticksys wrote:

Code: Select all

<?
echo nl2br("$MsyBody");
?>
=]
Better (faster):

Code: Select all

<?php
echo nl2br($MsyBody);
?>
=)
intellivision
Forum Commoner
Posts: 83
Joined: Mon Aug 22, 2005 1:25 am
Location: Orbit

Post by intellivision »

Worked perfectly.

Danke.
Post Reply