RSS displaying multiple feeds in time/date published order
Posted: Sat Jan 21, 2012 2:55 am
I'm trying to create a php rss parser that takes on multiple feeds, takes 10 entries from each, these all then get mixed together in an array and displayed in date order.
Atm i've got this:
[syntax=php]
<?php
require_once 'magpierss/rss_fetch.inc';
$num_items = 10;
$urls = array( "http://url1.com", "http://url2.com", "http://url3.com" );
foreach ($urls as $url) {
$rss = fetch_rss($url);
$items = array( $rss );
$items = array_slice($rss->items, 0, $num_items);
foreach ( $items as $item ) {
$title = $item[title];
$url = $item[link];
echo "<a href=$url>$title</a><br />";
}
}
?>
[/syntax]
The only bit I've got left to do is have them displayed in a collaborated date order but don't know how to get this done
. I'm a new comer to php and have gone nuts trying to sort this out, so any help/examples would be awesome!
Cheers =]
Atm i've got this:
[syntax=php]
<?php
require_once 'magpierss/rss_fetch.inc';
$num_items = 10;
$urls = array( "http://url1.com", "http://url2.com", "http://url3.com" );
foreach ($urls as $url) {
$rss = fetch_rss($url);
$items = array( $rss );
$items = array_slice($rss->items, 0, $num_items);
foreach ( $items as $item ) {
$title = $item[title];
$url = $item[link];
echo "<a href=$url>$title</a><br />";
}
}
?>
[/syntax]
The only bit I've got left to do is have them displayed in a collaborated date order but don't know how to get this done
![Sad :(](./images/smilies/icon_e_sad.gif)
Cheers =]