I have a lyrical website that i'm having problems getting something to work correctly,
When i have lyrics submitted to the database, the line breaks are correctly entered into the database without me having to put <br> after each line. However when i try to display the $lyrics variable on the site it puts the lyrics (which should be in poetry form) into paragraph form
i.e:
If i submit something like -
Roses Are Red
Violets Are Blue
The display on the site becomes
Roses Are Red Violets are Blue
Any way to fix this?
stupid question ...
Moderator: General Moderators
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
- shiznatix
- DevNet Master
- Posts: 2745
- Joined: Tue Dec 28, 2004 5:57 pm
- Location: Tallinn, Estonia
- Contact:
html does not use \n as a line break so you have to change any \n as a <br> but the best way would be as jcart said as that nl2br which basically does that changing \n to a <br> but it might be better if you just put all of the \n as a <br> in the database first off becuase it might just make everything a bit easier
-
Stewsburntmonkey
- Forum Commoner
- Posts: 44
- Joined: Wed Aug 24, 2005 2:09 pm