View Single Post

  #10 (permalink)  
Old 20-12-2007, 04:16 PM
Big D Big D is offline
Frontpage User
 
Join Date: Dec 2007
Posts: 24
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Big D will become famous soon enough
Default Number of items unaffected

Forbairt,

The array slice line hasn't affected the length of the feed - don't know whether I've done something wrong?--

Code:
<?php
require_once 'rss_fetch.inc';
$url = 'http://news.bbc.co.uk/rss/newsonline_uk_edition/northern_ireland/rss091.xml';
$rss = fetch_rss($url);
$items = array_slice($rss->items, 0, 5);
echo "Site: ", $rss->channel['title'], "<br>\n";
foreach ($rss->items as $item ) {
 $title = $item[title];
 $url   = $item[link];
 $description   = $item[description];
 echo "<a href=$url>$title</a><br>$description</li><br>\n";
}
?>
For what it might be worth I have set up a link to your site at the following url Free Irish Reference Works
Reply With Quote