Frage

Is it possible to use ksort to sort by maximum (ie. most recent) date with a SQL date time format? I have an array that is currently key-value where the key is the SQL date time format and the value is a string. When I do a ksort on it, it returns it by the least recent (I'm guessing the 'smallest') first and I want the reverse of that. Is there a flag that I don't know of that could set this or another function that could do it better?

War es hilfreich?

Lösung

If you just want the reverse order of ksort, use krsort.

Andere Tipps

If the data is from SQL, why not have the DBMS sort the date data into the correct order?

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top