php iteratively print the key and value of an array

Question:
How to iterate through an array and print the key and value

The code below shows how to iterate through an array and print the keys and values held within an array.

while (list($key, $val) = each($items)) {
  print $key . " -> " . $val;
}

To allocate within a new array simply:

while (list($key, $val) = each($items)) {
  $terms[] = $val . ") " . $key;
}
Taxonomy: