Welcome to WebmasterWorld Guest from

Forum Moderators: bill & werty

Message Too Old, No Replies

Help: Escaping Text/HTML for an RSS Feed

What's the best way to escape Text/HTML using PHP?



6:47 pm on Mar 5, 2005 (gmt 0)

Inactive Member
Account Expired


I've created an RSS 2.0 Feed for a friend of mine using PHP and MySQL. The author writes a ton of articles. I've worked out all the details of creating the feed in PHP, except for escaping characters for XML/RSS.

What's the best way to escape Text/HTML for an RSS 2.0 Feed using PHP? Can RSS descriptions contain HTML?

And... How might I escape out those "Mikrsooft" characters that I know the author will copy into the RSS descriptions?

Thanks in advance,


3:39 am on Mar 8, 2005 (gmt 0)

Inactive Member
Account Expired


hmmm.... I guess nobody knows... Or is this posted in the wrong forum?
4:47 am on Mar 8, 2005 (gmt 0)

Moderator This Forum from US 

WebmasterWorld Administrator 10+ Year Member

joined:Dec 3, 2002
votes: 4

I think this is the correct forum, but I do now if anyone knows the answer.
11:37 am on Mar 8, 2005 (gmt 0)

New User

10+ Year Member

joined:Jan 23, 2005
votes: 0

You do need escape characters in an RSS Feed. You can use The codes that start with &xx; etc. There are only a few you really need to consider ie < >

You can use html in an RSS feed, in my opinion though you should not use them as the feeds will be parsed and the user should decide how to view them.

You can also use cdata[] within your feed, it means all chsracters between the brackets should be shown as literal ie you do not need to use escape characters.

Do a search on google, there is some info out there.


Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members