문제

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