arsort() function maintains the original index association and sorts the elements in reverse order.
Its syntax is: void arsort (array array)
<?
$cities = array ("A" => "a",
"I" => "i",
"A" => "z",
"F" => "f",
"C" => "c");
arsort($cities);
for (reset ($cities); $key = key ($cities); next ($cities)) :
print "cities[$key] = $cities[$key] <br>";
endfor;
?>
Related examples in the same category