usort($drred, function($first, $second) use($by) {
if ($first[$by]>$second[$by]) { return -1; }
elseif ($first[$by]<$second[$by]) { return 1; }
return 0;
});
usort($drred, function($first, $second) use($by) {
if ($first[$by]>$second[$by]) { return -1; }
elseif ($first[$by]<$second[$by]) { return 1; }
return 0;
});
function cmp($a, $b) {
if ($a[4] == $b[4]) {
return 0;
}
return ($a[4] < $b[4]) ? 1 : -1;
}
for($i=0; $i<40; $i++){
$data_tmp=$drred;
uasort($data_tmp, 'cmp');
}