I’m using the following code to read a RSS feed. The problem is that I get wrong encoding. The code is in a file with UTF-8 encoding. Is there anything else I have to do to get it right?
$feed_url = "http://lujanenlinea.com.ar/noticias/feed";
$content = file_get_contents($feed_url);
$x = new SimpleXmlElement($content);
echo "<div class='rss-container'>";
echo "<ul class='rss-content'>";
foreach($x->channel->item as $entry) {
echo "<li><a href='$entry->link' title='$entry->title'>" . $entry->title . "</a></li>";
}
echo "</ul>";
Maybe use
utf8_encode()orutf8_decode()