james13009 Posted December 8, 2007 Share Posted December 8, 2007 Im using the above technologies to read feeds, i just need some help with my php coding, this is what i have that works, it reads the first 5 items in an xml feed: <?php include('../../Rss/chart2Rss/rss_fetch.inc');// Set error reporting for this error_reporting(E_ERROR);// Fetch RSS feed $rss = fetch_rss('http://www.nationalspares.co.uk/XML/rss3.xml'); if ($rss) { // Split the array to show first 5 $items = array_slice($rss->items, 0, 5); // Cycle through each item and echo foreach ($items as $item ) { echo '<li><a href="'.$item['link'].'">'.$item['title'].'</a> - '.$item['author'].'</li>'; }}else { echo '<h2>Error:</h2><p>'.magpie_error().'</p>';}// Restore original error reporting value@ini_restore('error_reporting'); ?> But what i really want it to do is to only select items within the feed with certain content, for example only select the items which have the category as "Hits" , in the feed here: http://www.nationalspares.co.uk/XML/rss3.xml So what im looking for is a 'where' statement, any help appreciated Thanks in advance James Link to comment https://forums.phpfreaks.com/topic/80811-php-xml-and-magpie/ Share on other sites More sharing options...
james13009 Posted December 9, 2007 Author Share Posted December 9, 2007 *bump* Link to comment https://forums.phpfreaks.com/topic/80811-php-xml-and-magpie/#findComment-410257 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.