PHP Sort the element of an array in reverse order – PHP May 11, 2011 Pramod T P Leave a comment <?php $testArray = array("p", "c", "z", "a"); rsort($testArray); print_r($testArray); //Array ( [0] => z [1] => p [2] => c [3] => a ) ?>