Results 1 to 3 of 3
Thread: Multidimensional Array Output
Aug 20, 2012, 06:11 #1
- Join Date
- Feb 2008
- 0 Post(s)
- 0 Thread(s)
Multidimensional Array Output
I find myself asking the database for the same information, sometimes in the same script. I'd like to save the data in an array, then output the data in a <select><option> drop down.
So far I've got the data in an array called $agentList like so:
The array data looks like this:
Array (  => Array ( [admin_id] => 40 [first_name] => Tom [last_name] => Clemente )  => Array ( [admin_id] => 47 [first_name] => Thomas [last_name] => Conlin )  => Array ( [admin_id] => 45 [first_name] => Bob [last_name] => Deangelis )  => Array ( [admin_id] => 62 [first_name] => Gabby [last_name] => Gascon ) )
I'm lost after that. I'd like the data to output:
<select name="agent"> <option value="40">Tom Clemente</option> etc...
Any help is much appreciated and will only make me a better programmer!