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