this a rather difficult function i think:
first - you'll have to make a loop to listen $dan
second - you'll have to store the values in 2 different arrays:
array1: the time as key and the $dan[key] as value
array2: the time as value
third - order array2
fourth - use array1 to reassign the ordered array2 to the $dan array
and after that you have sorted the $dan array
Good Luck i'ld say
OR you could switch "time" with "date" that way it'll sort the array by time instead of date, as it did earleir
Greetz,
UnrealEd