|
Posted by petersprc on 08/17/07 01:10
Seems to be a typo, comparison should be $a < $b.
I would make sure error_reporting(E_ALL) is on to see if that gives
any hints.
On Aug 15, 12:08 am, junkmate <junkm...@gmail.com> wrote:
> I am making an RSS parser that takes multiple XML inputs in to an
> array and then sorts them by their date value... and it 'almost'
> works... I always lose the top value of the second rss feed to be
> parsed... its pretty annoying as this is often the most recently
> updated RSS item that is missing from my multi-feed...
>
> Help me please:
>
> Currently, I am doing this:
>
> usort($xmlreader_parsed_data, "rss_cmp");
>
> which calls this function:
>
> function rss_cmp($a, $b)
> {
> $a = strtotime($a->date);
> $b = strtotime($b->date);
>
> if ($a == $b) {
> return 0;
> }
> return ($a > $b) ? -1 : 1;
> }
Navigation:
[Reply to this message]
|