Quick question: How would I switch the sort order between ascending/descending in the following function? All it does is order a multidimensional array by a chosen field, and then by title.
$sortby = 'date';
$orderby = 'asc';
function sort($a, $b)
{
$retval = strnatcmp($a[$sortby], $b[$sortby]);
if(!$retval) return strnatcmp($a['title'], $b['title']);
return $retval;
}
uasort($jobs, 'sort');
I'll be very grateful for any help. :)