AboutBlogContact
Web DevelopmentNovember 5, 2004 2 min read 131Updated: June 22, 2026

RSS 2.0: Parsing the New Standard for Content Syndication (2004)

AunimedaAunimeda
📋 Table of Contents

RSS 2.0: Parsing the New Standard for Content Syndication

It is 2004, and the "Blogosphere" is exploding. Everyone is using RSS (Really Simple Syndication) to keep up with their favorite sites without having to visit them manually. While there are competing formats like Atom, RSS 2.0 (released by Dave Winer) has become the dominant standard.

If you are a PHP developer, 2004 is also exciting because of the release of PHP 5.0. It includes a revolutionary new extension called SimpleXML, which makes parsing XML files-like RSS feeds-as easy as accessing an object.

The RSS 2.0 Structure

An RSS feed is just an XML file with a specific structure. The root is <rss>, followed by a <channel>, which contains many <item> elements.

<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>My Awesome Blog</title>
    <link>http://example.com/</link>
    <item>
      <title>Entry One</title>
      <link>http://example.com/1</link>
      <description>This is the first entry.</description>
      <pubDate>Wed, 15 Dec 2004 12:00:00 GMT</pubDate>
    </item>
  </channel>
</rss>

Parsing with PHP 5's SimpleXML

In PHP 4, we had to use complex SAX or DOM parsers. In PHP 5, it's a one-liner.

<?php
// Load the RSS feed
$rss = simplexml_load_file('http://example.com/rss.xml');

echo "<h1>" . $rss->channel->title . "</h1>";

// Loop through each item
foreach ($rss->channel->item as $item) {
    echo "<div>";
    echo "<h3><a href='{$item->link}'>{$item->title}</a></h3>";
    echo "<p><i>{$item->pubDate}</i></p>";
    echo "<p>{$item->description}</p>";
    echo "</div><hr>";
}
?>

Handling Namespaces

Some feeds use namespaces (like MediaRSS or Content encoded). SimpleXML handles these with the children() method.

// If the feed has <content:encoded>
$content = $item->children('http://purl.org/rss/1.0/modules/content/');
echo (string)$content->encoded;

The combination of RSS 2.0 and PHP 5 is making the web more interconnected than ever. We're moving from a "destination web" to a "syndicated web," where content finds the user.


Aunimeda develops websites and web applications for businesses - corporate sites, e-commerce, portals, and custom platforms.

Contact us to discuss your web project. See also: Web Development, E-commerce Development

Read Also

xajax: Building Interactive PHP Apps Without the JavaScript Headache (2004)aunimeda
Web Development

xajax: Building Interactive PHP Apps Without the JavaScript Headache (2004)

Is AJAX too hard? xajax allows you to update your web page asynchronously by writing almost nothing but PHP code. No more manual XMLHttpRequest object handling.

WordPress 1.0: The Fork That Changed Content Managementaunimeda
Web Development

WordPress 1.0: The Fork That Changed Content Management

Matt Mullenweg and Mike Little have turned the abandoned b2/cafelog project into WordPress 1.0. It's clean, it's PHP-based, and it's making blogging accessible to everyone.

The Visual Web: Generating Dynamic Graphics with PHP 4.3 and GD (2003)aunimeda
Web Development

The Visual Web: Generating Dynamic Graphics with PHP 4.3 and GD (2003)

With PHP 4.3, the GD library is now bundled, making server-side image generation easy. Stop serving static banners; learn to create dynamic charts and watermarks on the fly.

Need IT development for your business?

We build websites, mobile apps and AI solutions. Free consultation.

Web Development

Get Consultation All articles