Written: July 14, 2009

Adding an RSS Feed with PHP


I have a marketing web site at www.marketingeda.com and when I updated from PHP 4 to 5 my RSS feed reader stopped working. So I browsed for a simple replacement that worked well with PHP 5 and found something called MagpieRSS at SourceForge that worked wonderful.

Here’s the simple PHP code that I needed to insert on my page where I wanted the RSS feed to appear:

require(‘classes/rss/rss_fetch.inc’);
$rss = fetch_rss(‘http://www.chipdesignmag.com/payne/feed/’);
foreach ($rss->items as $item ) {
$title = $item[title];
$url = $item[link];
$description = $item[description];
echo “<a href=$url>$title</a></li><br>$description<br>”;
}

1
<br />

Here’s what this feed outputs on my page:

Tags: ,

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Blog Tags

Recent Posts

Blog Directory & Business Pages at OnToplist.com