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; }