Welcome to WebmasterWorld Guest from

Forum Moderators: bill & werty

Message Too Old, No Replies

Using Magpie: Selecting the RSS Feed Information, (not the individual

I am using Magpie and I just want to parse out the RSS feed information



2:41 am on Jan 29, 2006 (gmt 0)

10+ Year Member

I am trying to find a way to print the top information about an RSS file. For instance I am using the following CNET RSS file:


You will see the top few lines of the feed are:

<title>CNET News.com</title>
Tech news and business reports by CNET News.com. Focused on information technology, core topics include computers, hardware, software, networking, and Internet media.

These are not <item> tags -- this is the top part of the CNET News RSS.

I want to parse this information and insert it into a database so how would I put each <tag> into its own variable $sitetitle, $sitelink, $sitedescription?

I imagine

foreach ($rss->items as $item ) {

doesn't work since these aren't items, how would one do it?


12:15 pm on Jan 29, 2006 (gmt 0)

10+ Year Member

These infos should be in the $rss->channel array, e.g. $rss->channel["title"]. Try

foreach ($rss->channel as $key=>$value) {
echo $key.": ".$value;


Featured Threads

Hot Threads This Week

Hot Threads This Month