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?

有帮助吗?

解决方案

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

其他提示

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top