load('http://the217.com/feeds/amuzu_events.rss'); $arrFeed = array(); //then we'll parse it into something we can actually use foreach ($doc->getElementsByTagName('item') as $node) { //grab the category first, since we need it to sort things by $cat = $node->getElementsByTagName('category')->item(0)->nodeValue; //get the rest of the data $itemRSS = array ( 'title' => $node->getElementsByTagName('title')->item(0)->nodeValue, 'category' => $cat, 'desc' => $node->getElementsByTagName('description')->item(0)->nodeValue, 'link' => $node->getElementsByTagName('link')->item(0)->nodeValue, 'date' => $node->getElementsByTagName('pubDate')->item(0)->nodeValue, 'venueName' => $node->getElementsByTagName('venueName')->item(0)->nodeValue, 'venueAddress' => $node->getElementsByTagName('venueAddress')->item(0)->nodeValue, 'venueName' => $node->getElementsByTagName('venueName')->item(0)->nodeValue, 'venueCity' => $node->getElementsByTagName('venueCity')->item(0)->nodeValue, ); //the enclosure has to be treated special, because not all items have one, and because //we need an attribute value rather than the nodeValue $enclosure = $node->getElementsByTagName('enclosure')->item(0); if($enclosure) { $itemRSS['enclosure'] = $enclosure->getAttribute('url'); } //slap it all together $arrFeed[$cat][] = $itemRSS; } //output and format everything echo '
';
echo 'Brought to you by our sister Web site the217.com