今天收到PHPCLASS发来的邮件...
看到这个新类介绍很不错...
现在转来给大家参考一下...
RSS_PHP is a free RSS Parser and XML Parser for PHP 5+, utilising the DOM to parse any valid XML Document including RSS, with provisional support for ATOM feeds.
Unlike many RSS Parsers, RSS_PHP also gives you full access to every part of the original RSS feed; including RSS attributes, RSS extensions, XML namespaces, XML stylesheets and node values.
I've specifically kept this RSS Parser as simple as possible. Here's a working example which will parse a full RSS feed, it'll also automatically convert the XML Document to UTF-8 from any other encoding:
<?php
$rss = new rss_php;
$rss->load('http://rssphp.net/rss.xml');
$items = $rss->getItems(); #returns all rss items
?>
IMPORTANT: A major peice of relatively unknown functionality is that RSS_PHP returns the actual DOMElements from the raw DOMDocument (although they have been modified slightly) - meaning that from any returned element you can access the full DOMDocument and have access to all the normal PHP DOM properties and methods.
Full documentation and examples of RSS_PHP are available on the site, or you can download the latest version of RSS_PHP for all your RSS & XML Parsing needs for free.
http://www.phpclasses.org/browse/package/4393.html
