The fruits have been sorted in reverse alphabetical order, and the index associated with each element has been maintained.
?php $fruits = array( "d"= "papaye" ,"a"= "orange" ,"b"= "banane" ,"c"= "ananas"); arsort ($fruits); for (reset ($fruits); $key = key ($fruits); next ($fruits)) {echo "fruits[$key] = ".$fruits[$key] ."\n";}?