/* feedvalidator.org (Feedburner recommends this site to validate your feeds) says: "For the widest interop, the RSS Profile recommends the use of the hexadecimal character reference "&" to represent "&" and "<" to represent "<". */
// find title problems
$find[] = '<';
$find[] = '\x92';
$find[] = '\x84';
// find content problems
$find_c[] = '\x92';
$find_c[] = '\x84';
$find_c[] = ' ';
// replace title
$replace[] = '<';
$replace[] = ''';
$replace[] = '"';
// replace content
$replace_c[] = ''';
$replace_c[] = '"';
$replace_c[] = ' ';
// We don't want to re-replace "&" characters.
// So do this first because of PHP "feature" https://bugs.php.net/bug.php?id=33773
$title = str_replace('&', '&', $title);
$title = str_replace($find, $replace, $title);
$post_content = str_replace($find_c, $replace_c, $row[3]);
// http://productforums.google.com/forum/#!topic/merchant-center/nIVyFrJsjpk
$link = str_replace('&', '&', $link);
Of course I'm doing some pre-processing before $title, $post_content and $link are added to my database. But this should help solve some common problems to get a valid RSS feed.
Update: Fixed the &#x26;#x26; "recursion" problem, see https://bugs.php.net/bug.php?id=33773