Iterating over a PHP associative array by key
The PHP scripting language
provides associative
arrays that allow one to associate a key in the array to a value; each key
in the array must be unique. E.g., I can create an array of United States
presidents that uses the presidents' names as the keys and their political
party affiliation as the value for each key. I could then iterate through
the array by key and show the corresponding value for each key as in the
example PHP code.