SimplePie 1.3.1 is now available. Upgrade now!

SimplePie Documentation.  Learn how to use this thing.  It's way better than going to school.

You are here: Documentation » API Reference » SimplePie » merge_items()



class SimplePie {
	merge_items ( array $objects,  [int $start = 0],  [int $length = 0])

This method merges the items from multiple SimplePie objects.

:!: If you're merging multiple feeds together, they need to all have dates for the items or else PHP will sort them to the top.


  • Available since SimplePie 1.0.


objects (required)

An array of SimplePie objects.


The number of the item you want to start at. Remember that arrays begin with 0, not 1.


The number of items to return. 0 will return all. The start parameter is required if this is used.


Set the feed URL to the SimplePie blog

$digg = new SimplePie('');
$tuaw = new SimplePie();
$uneasy = new SimplePie('');
$merged = SimplePie::merge_items(array($digg, $tuaw, $uneasy));
header('Content-type:text/html; charset=utf-8');
$item = $merged[0];
echo $item->get_title(); 

See Also

reference/simplepie/merge_items.txt · Last modified: 2011/03/05 19:56 (external edit)