Re: [PHP] Sort Array by date

2003-12-04 Thread Curt Zirzow
* Thus wrote Matt Palermo ([EMAIL PROTECTED]): > I have a bunch of dates in the form: MM-DD- in an array and I want to > sort them and display them in descending order. I have tried the usort() > function below and it's not working. Can anyone help me out here? > > $menu_item = array(); > $m

RE: [PHP] Sort Array by date

2003-12-04 Thread Martin Towell
Hiya, I changed your date_file_sort() function so it echos a few things function date_file_sort($a, $b) { echo "$a - $b - "; $a = strtotime($a); $b = strtotime($b); echo "$a - $b - ".date("d-M-Y", $a)." - ".date("d-M-Y", $b)."\n"; return strcmp($a, $b); } "interesting" result