I'm currently using a script very successfully to publish headlines on a page of my site:
http://www.platinax.co.uk/news/extra/
However, I'd like to be able to publish the feed descriptions under the linked headlines.
How could I please modify the following code to publish descriptions as well?
Code:
<?php
$xmlfile = file_get_contents ("http://news.bbc.co.uk/rss/newsonline_uk_edition/business/rss091.xml");
if (empty($xmlfile))
die("failed to connect to xml feed");
preg_match_all("|<item>(.*)</item>|sU", $xmlfile, $items);
$itemlist = array();
foreach ($items[1] as $key => $item)
{
preg_match("|<title>(.*)</title>|s", $item, $title);
preg_match("|<link>(.*)</link>|s", $item, $link);
$itemlist[$key]['title'] = $title[1];
$itemlist[$key]['link'] = $link[1];
}
// Display all article titles, linking them to the actual story
foreach ($itemlist as $item)
{
echo '<a href="' . $item['link'] . '">' . $item['title'] . '</a><br>';
}
$xmlfile = ""; // empty out the xmlfeed variable so that you can test the next one.
?>
I presume the modification would be fairly simple?
By the way - many thanks in advance for reading this.