Page 1 of 1

Posted: Wed Oct 18, 2006 11:54 am
by SomeOne
i have alsow an issue on array sorting...
i have array full of date's like
1.12.2006
3.12.2006
2.12.2007
i use sort($myarray);
and then i get
1.12.2006
2.12.2007
3.12.2006
ok, its is sorted, though not right... i want to be sorted by date...
can anyone tell me how to do this? 8O

Posted: Wed Oct 18, 2006 12:03 pm
by SomeOne
i have found "usort" function though dont really understand, how to set it up, to work 4 me
anyone? :roll:

Posted: Wed Oct 18, 2006 12:56 pm
by Ollie Saunders
convert the dates to a unix timestamp, sort that, convert them back again.

Code: Select all

strtotime(), sort(), date()