This site is mobile accessible. Press the "Tap Here" button to use a different font-size.


Smartphone icons created by Freepik - Flaticon

PHP Arrays

Sorting Arrays

BMW
Toyota
Volvo

<?php
// define array $cars with 3 objects
$cars = array("Volvo", "BMW", "Toyota");

// sort the $cars array in alphabetical order
sort($cars);

// display $cars sorted alphabetically
$clength = count($cars);
for($x = 0; $x < $clength; $x++) {
  echo $cars[$x];
  echo "<br>";
}
?>