PDA

View Full Version : [PHP] Adding new lines to an rss feed



ELD
July 4th, 2010, 10:33 PM
Hi all i run the website GamingOnLinux (http://www.gamingonlinux.info) and am having a little trouble with my rss feed.

It is a custom design -> http://www.gamingonlinux.info/news_rss.php currently i remove the br tags and replace them with \n but it doesn't seem to give it a new line...so currently all the text is squished together :(

Can anyone give me a few tips?

Cheers :KS

ju2wheels
July 5th, 2010, 10:15 PM
Well, you had it correctly before to be honest. A newline (\n) in HTML/XHTML code is always ignored. If you want to add a line break it has to be <br /> .

If you are reading the XML into something else and parsing it, then you should be replacing <br /> with a space or newline so that the words at the end and beginning of a sentence dont turn into one word.

I would also run the output of each section through htmlentities().

ELD
July 11th, 2010, 04:08 PM
Trouble is when i leave them in the text disappears on the firefox rss reader.