This tutorial will show you how to make a simple RSS parsing script.
Here is the whole code, look below for a walk through of the script.
$file = file_get_contents("Feed URL");
$xml = new SimpleXMLElement($file);
foreach($xml->channel->item as $feed){
echo $feed->title.'<br>';
}
Code Breakdown
$file = file_get_contents("Feed URL");
$xml = new SimpleXMLElement($file);
This gets retrieves the RSS Feed
foreach($xml->channel->item as $feed){
echo $feed->title.'<br>';
}
This gets each item from the feed and parses them.
Demo: Link - Using the Unreal Media RSS feed
Source: Download






































October 15th, 2008 at 6:01 am
found your site on del.icio.us today and really liked it.. i bookmarked it and will be back to check it out some more later ..
October 16th, 2008 at 4:47 am
found your site on del.icio.us today and really liked it.. i bookmarked it and will be back to check it out some more later ..
November 2nd, 2008 at 4:02 pm
Hey stumbled on this after looking on pixel2life.com, This is a good start to looking in to how to parse xml but it doesn’t really explain each line in a depth enough for me to understand how to do it, But i like this site and ill look at the others you have written thanks
November 12th, 2008 at 8:44 pm
Is there anyway to parse content:encoded xml tags? I’m getting php errors when I try and write $feed->content:encoded. Any ideas?
November 22nd, 2008 at 7:33 am
i7365jdqp6mzy80h
ynkwkcp aztllace
http://uoyobhhvbiz.com
dqxsran xnkq
http://rokkyvuyc.com
fzkmay lqyhtz
http://vqmllcaspia.com
whxdjoz rsti
http://ppfdmxm.com
pmzegb ckcuka
http://lamprrawpqeu.com
aaotnt orbc
http://hmoufqqgjjfz.com
rochej hccxhzse
http://dchppz.com
zqcin hiumdq
http://uzorfka.com
pzsdpm tjjdsg
http://ydkkjicxc.com
gkqjes ailv
http://kpdwxmn.com
December 24th, 2008 at 10:57 am
Hey great code!! I used it on my site http://www.gingerlavendar.com to generate site with RSS feeds and Adsense.