To reverse sort an enumerated array, use the rsort () function
<?php $emp_names []= "D"; $emp_names []= "B"; $emp_names []= "A"; $emp_names []= "C"; $emp_names []= "E"; rsort ($emp_names); foreach ($emp_names as $val) { echo "$val", "\n"; } ?>