Hello, I have info in a mysql table that is stored with paragraphs but when I echo it it all comes out in one big blob.
Is there a resolution?
For example this:
This is a paragraph Here are a few more words.
This is a second paragraph. Here are a few more words.
Displays this:
This is a paragraph Here is a few more words. This are a second paragraph. Here are a few more words.
Thanks alot.
Hi Dolemite,
It's the way HTML works ... newlines (\n) aren't recognised. The simplest solution is to use nl2br().
Paul
Thank you very much, thats exactly what I wanted. 🙂
Just one question, I noticed that if the info was pasted in from an html page, it displays <br /> where the breaks would be. Is there a resolution for that?
Thanks again, I really appreciate it.
You could do a string replace, but probably are best to use strip_tags to remove all html tags if you are pasting from a web page.
Hey thanks alot, this seems to be working:
$lyrics = strip_tags(nl2br($lyrics));
Is there any problem with that?
Thanks again.