Up-to-date articles will return when migration completes. Meanwhile viewing an old database.

WP C – Temp

php logo

Finding myself annoyed at an RSS feed which was being rendered with the incorrect character encoding, I searched for the proper way to correct the output. I’m sure there are other ways to do it, but the following worked for me.

Using MagpieRSS, i’ve fetched the RSS feed and prepared it for output using a foreach loop. I used the PHP function utf8_encode() to correctly render the charset.

foreach ($rss->items as $item) {
        $href = $item['link'];
        $title = $item['title'];
        print '<li class="rssfeeditem"><a href="' . $href .
'" target="_blank">' . utf8_encode($title) .'</a></li>';
}

Whatchu do

You. Yes, you!

โ€œStand still, Laddy!โ€
Don’t want to sign-in to leave a comment? Send an email with this contact form. I’m not tracking you, but I would like your opinion about what needs improving!

,

Leave a Reply

Your email address will not be published. Required fields are marked *