Jump to content

linebreaks into divs from mysql


freelance84

Recommended Posts

I have a similar problem to this thread, but not quite:

http://www.phpfreaks.com/forums/index.php/topic,305228.0.html

 

In a MySQL table of format MyISAM I have a long text string. The string has a few line breaks here an there as it is input from a text area.

 

These line breaks are formatted ok when inputted into another textarea. However, when I try to put the text into a normal div, the line breaks are ignored and the text is viewed as one big lump (a big paragraph), like this:

Football practice this month for the gremlins: Mike Jones on every other saturday. Smith on every other sunday.

 

 

When i view the source however the breaks are there (sort of), here's the source of the html:

 

Football practice this month for the gremlins:

 

Mike Jones on every other saturday.

 

Pete Smith on every other sunday.

 

As you can see, the line breaks are there in the source code, but there are no line breaks printed in the browser. How do I add <br/> when I've nothing to search for (if that makes sense [how the text looks int he source is also how it is stored in mysql table])

 

Link to comment
https://forums.phpfreaks.com/topic/208652-linebreaks-into-divs-from-mysql/
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.