<?php
$fruits = array("lemon", "orange", "banana", "apple");
rsort($fruits);
foreach ($fruits as $key => $val) {
echo "$key = $val\n";
}
?>
The above example will output:
0 = orange
1 = lemon
2 = banana
3 = apple
The fruits have been sorted in reverse alphabetical order.