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); ?>
Sample Output:
Array ( [0] => White [1] => Red [2] => Orange [3] => Black )
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
Array ( [0] => White [1] => Red [2] => Orange [3] => Black )need an explanation for this answer? contact us directly to get an explanation for this answer