Try replacing the whole DateCmp() function with...
code:
function DateCmp($a, $b)
{
if($a[1] == $b[1]) return 0;
return ($a[1] < $b[1]) ? -1 : 1;
}
That should fix the bug. To get descending order, just add this line...
code:
$Files = array_reverse($Files);
...above the foreach() loop. (Yes, that's the lazy way to do it

)