I have an array like this (test data):
animals = array(
"A"=>array("Aardvark"),
"B"=>array("Bee"),
"C"=>array("Cat"),
//etc...
);
Then I want to iterate through it to build an html select statement. Here's my code for within the select tags:
foreach($animals as $e)
echo("<option value='" . key($e) . "'>" . $e[0] . "</option>\n");
However, this always displays the key as 0 rather than "Aardvark" etc
Any ideas how to iterate through and set the value of each Option to Aardvark, Bee, Cat, in turn?
Thanks!