Reading RSS and Atom Feeds using MagpieRSS parser

Using the MagpieRSS parser here’s an example that reads the RSS feed.

<?php
require 'rss_fetch.inc';
 
$feed = 'http://feeds.feedburner.com/w3mentor?format=rss';
 
$rss = fetch_rss( $feed );
 
print "<ul>\n";
foreach ($rss->items as $item) {
    print '<li><a href="' . $item['link'] . '">' . $item['title'] . "</a></li>\n";
}
print "</ul>\n";
?>

Share Article/Example:
  • DotNetKicks
  • DZone
  • StumbleUpon
  • Print
  • Add to favorites
  • Digg
  • del.icio.us
  • Twitter
  • Facebook
  • LinkedIn
  • Posterous
  • Slashdot

Filed Under: PHP XML Examples

RSSComments (0)

Trackback URL

Leave a Reply




If you want a picture to show with your comment, go get a Gravatar.