rarebit Posted September 2, 2008 Share Posted September 2, 2008 Hi, i've just been having a play with rss, version 2 slid into place but version 1 seems to have variations and the official php docs don't mention rdf, any clues please? function xml_load($fn) { if (file_exists($fn)) { $xml = simplexml_load_file($fn); return $xml; } return -1; } function xml_print_e($e) { if( (isset($e->link)) && (isset($e->title)) ) { print '<a href="'.$e->link.'">'.$e->title.'</a><br>'; } elseif( isset($e->title) ) { print $e->title.'<br>'; } if(isset($e->description)) { print $e->description.'<br>'; } print '<br><br>'; } //$fn = "data/rss1.xml"; $fn = "data/rss2.xml"; $xml = xml_load($fn); print $xml->attributes()->version; print "<br><br>"; $x = $xml->channel; xml_print_e($x); foreach ($x->item as $e) { xml_print_e($e); } Link to comment https://forums.phpfreaks.com/topic/122448-rss-10-or-rdf/ Share on other sites More sharing options...
rarebit Posted September 4, 2008 Author Share Posted September 4, 2008 ??? Link to comment https://forums.phpfreaks.com/topic/122448-rss-10-or-rdf/#findComment-633699 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.