$carsArray = array( "Volvo", "Honda", "Toyota", "BMW"); sort($carsArray); $no_car = count($carsArray); for( $x=0; $x<$no_car; $x++ ) { echo $carsArray[$x]; echo "<br>"; }