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