An Associative Array is an array in which the keys are associated with values.
<?php
$truck[“Toyota”] = Tundra;
$truck[“Nissan”] = Titan;
$truck[“Dodge”] = Ram;
?>
A Syntax example using the Associative Array above:
echo "Toyota makes the " . $truck[“Toyota”] . "<br />";
echo "Nissan makes the " . $truck[“Nissan”] . "<br />";
echo "Dodge makes the " . $truck[“Dodge”];
And, when viewed in a browser...
You may not see the usefulness of the Array and Associative Array right now, but I think (hope) it will come together a little more once we hit the next lesson - LOOPS.