SimplePie 1.5 is now available!

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

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

enable_order_by_date()

Description

class SimplePie {
	enable_order_by_date ( [bool $enable = true] )
}

Sometimes feeds don't have their items in chronological order. By default, SimplePie will re-order them to be in such an order. With this option, you can enable/disable the reordering of items into reverse chronological order if you don't want it.

Availability

  • Available since SimplePie 1.0.
  • Previously existed as order_by_date() since SimplePie Beta 2.

Parameters

enable

Set whether items should be re-ordered. Defaults to true.

Examples

Disable re-ordering chronologically

$feed = new SimplePie();
$feed->set_feed_url('http://simplepie.org/blog/feed/');
$feed->enable_order_by_date(false);
$feed->init();
$feed->handle_content_type();
echo $feed->get_title();

See Also


reference/simplepie/enable_order_by_date.txt · Last modified: 2011/03/06 03:56 (external edit)