If i had a select box
<select><option>...<option></select>
and I had an array of values from 1-12
using php, how would I auto populate that select box using that array?
supposing the array looks like:
$array = array( 1=>"My first option", 2=> "My second option" ); <select> <?php foreach($array as $key => $value) { ?> <option value="<?php echo $key ?>"><?php echo $value ?></option> <?php }?> </select>
1.4m articles
1.4m replys
5 comments
57.0k users