I have an array like this:
$images[] = array('filename' => $f, 'width' => $width, 'height' => $height, 'size' => $size, 'date' => $date);
Which has been ordered by date, using the following function:
function multi_sort($tab,$key){
$compare = create_function('$a,$b','if ($a["'.$key.'"] == $b["'.$key.'"]) {return 0;}else {return ($b["'.$key.'"] > $b["'.$key.'"]) ? -1 : 1;}');
usort($tab,$compare) ;
return $tab ;
}
multi_sort($images, "date");
All works great, but it's ordered with the oldest date first - I need to reverse the order of the array by date.
Any idea??