PHP Array Exercises : Sort an array in reverse order
PHP Array: Exercise-28 with Solution
Write a PHP script to sort an array in reverse order (highest to lowest).
<?php $colors = array("Red", "Orange", "Black", "White"); rsort($colors); print_r($colors); ?>
Array (  => White  => Red  => Orange  => Black )
PHP Code Editor:
Contribute your code and comments through Disqus.
Previous: Write a PHP function to generate a random password (contains uppercase, lowercase, numeric and other) using shuffle() function.
Next: Write a PHP program to generate an array with a range taken from a string.
What is the difficulty level of this exercise?