[PHP] Re: Sort Array by date

2003-12-04 Thread Al
> 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? Your sorting function uses strtotime, which doesn't recognise data in the MM-

[PHP] Re: Sort Array by date

2003-12-04 Thread Luke
an easy way, but might not work in your case is to use sort() if instead of storing the dates like 12-04-2003, could you prehaps store them as 2003-04-03 year-month-day and then you could use $datearray = sort($datearray, SORT_STRING); would this work for you? -- Luke "Matt Palermo" <[EMAIL