How can i sort efficiently this array (recent items first) on end_time value in PHP?
end_time
array 0 => array \'value\' => int 4
Try:
function sort_datewise($x, $y) { $t1 = strtotime($x['end_time']); $t2 = strtotime($y['end_time']); return $t1 - $t2; } usort($array, 'sort_datewise');