So I have an RSS feed 开发者_StackOverflow社区created by a list of blogs. every now and again someone using the WYSIWYG editor in the CMS puts in some random character and it makes the feed invalid.
I have forced UTF8 encoding, and been doing string replace on the chars that slip through, but I wondered is there a nice quick and easy RSS cleaning / sanitising function that would always return valid RSS no matter what was put in?
Edit: Also a solution without using frameworks such as PEAR / Zend would be ideal :)
What kind of characters are you talking about here? Will PHP's built in htmlspecialchars() function do what you want?
See: http://php.net/manual/en/function.htmlspecialchars.php
精彩评论