Is there an option in PHP to sort an array by key value descending?
I am aware that you can sort key values with ksort
Yes, the krsort
$fruits = array("d"=>"lemon", "a"=>"orange", "b"=>"banana", "c"=>"apple");
krsort($fruits);
I believe krsort() is what you're looking for.
http://www.php.net/manual/en/function.krsort.php krsort?
精彩评论