Is there a way to choose the sorting of ksort?

Neta Meta picture Neta Meta · Nov 27, 2013 · Viewed 28.7k times · Source

I have a use for ksort() and I need to choose the sorting order(ASC/DESC).

Is there a way of doing it without array_multisort()?

Answer

Matthew picture Matthew · Nov 27, 2013

krsort() for descending order
ksort() for ascending order