krsort
Sort an array by key in descending order
&reftitle.description;
boolkrsort
arrayarray
intflagsSORT_REGULAR
Sorts array in place by keys
in descending order.
¬e.sort-unstable;
&reftitle.parameters;
array
The input array.
&sort.flags.parameter;
&reftitle.returnvalues;
&return.true.always;
&reftitle.examples;
krsort example
"lemon", "a"=>"orange", "b"=>"banana", "c"=>"apple");
krsort($fruits);
foreach ($fruits as $key => $val) {
echo "$key = $val\n";
}
?>
]]>
&example.outputs;
&reftitle.seealso;
sort
ksort
&seealso.array.sorting;