I have a lot of data that contains characters that will normally break RSS. Is there a function or library in PHP that will handle these characters so they are suitable to be printed in an RSS Feed?
views:
52answers:
3
+1
A:
RSS is simply XML. So the characters escaped by htmlspecialchars() should be sufficient or htmlentities() escapes some extra characters, which might be useful.
Brenton Alker
2010-05-28 00:53:42
A:
http://php.net/manual/en/function.htmlentities.php
Take a look at the comments, there are some xmlentities
functions there you can use (since RSS is XML).
Amber
2010-05-28 00:54:00
A:
Use htmlentities() and it will encode the strange character in a strange encoding but it wouldn't break RSS.
ZZ Coder
2010-05-28 00:54:54