Reading RSS feeds with PEAR xml_rss package
   Main Menu

HOME

.Net
ASP
Assembly
C
C++
Delphi
HTML
Java
JavaScript
MySQL
PC interface
Powershell
Perl
PHP
VBScript
Visual Basic
XML

US Job listings




   Misc

   Amazon

   Links

Reading RSS feeds with PEAR xml_rss package

 

This example shows how to retrieve an RSS feed and display all of the items in it. This uses the PEAR xml_rss package . In this case we use the PHP.net RSS feed.

You can download this from here


 

 

<?php
ini_set("include_path", '/home/path_to_include_folder/xmlrss/' . PATH_SEPARATOR . ini_get("include_path"));
require_once 'RSS.php';
$rss_feed = 'http://www.php.net/news.rss';
$rss =& new XML_RSS($rss_feed);
$rss->parse();
print "<ul>\n";
foreach($rss->getItems() as $item)
{
echo "<li><a href=\"" . $item['link'] . "\">" . $item['title'] . "</a></li>\n";
}
print "</ul>\n";
?>

 

Example



 




   Sponsors
 

   Software
500 Java Tips E-book
PHP editor
PERL editor
Beginning Java
Beginning Visual Basic
Learn VB.net
Learn VB 6
VB and databases
ASP image library
C++ builder programming
C++ fundamentals

   Source Code
launch a website(Darkbasic)
Launch format dialog box(VB)
gethostbyaddr function(PHP)
Beep(VB)
set text colour(CSS)
While loop(PHP)
using the md5 function to encrypt data(php)
Access connection(VB)




Copyright © 2004 by programmershelp.co.uk