I have this function:
function validate($data) {
$newData = str_replace(" ", " ", $newData);
$newData = utf8_encode(htmlentities(strip_tags($data)));
return $newData;
}
$rssfeed.='<description><![CDATA['.validate($news).']]></description>';
MY MySQL table that it draws from uses utf8-general_ci encoding.
However, my XML feed still has in it. Any ideas why?
You’re using your variables in the wrong order, so you are ignoring the result of
str_replace.should be