Since the elements of the array are strings, you need to convert them to a date and then compare with sorting. usort()sort the array using a custom function, which is a good sort function for this case.
$arr = array('11-01-2012', '01-01-2014', '01-01-2015', '09-02-2013', '01-01-2013');
function date_sort($a, $b) {
return strtotime($a) - strtotime($b);
}
usort($arr, "date_sort");
print_r($arr);
Check the result in the demo
source
share