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


Smartphone icons created by Freepik - Flaticon

PHP Associative Arrays

Loop Through an Associative Array part 1

brand: Ford
model: Mustang
year: 1964

<?php
// define an associative array $car
$car = array("brand"=>"Ford", "model"=>"Mustang", "year"=>1964);

// loop through an associative array
foreach ($car as $x => $y) {
  echo "$x: $y <br>";
}
?>