You may modify the behavior of the sort using the optional parameter sort_flags, for details see sort().
?php $fruits = array( "d"= "papaye" ,"a"= "orange" ,"b"= "banane" ,"c"= "ananas"); ksort($fruits); for(reset($fruits); $key = key($fruits); next($fruits)) {echo "fruits[$key] = ".$fruits[$key] ."\n";}?