Currently, my checkboxes are built by a static array:
$choices = array(
'key_1' => 'Name 1',
'key_2' => 'Name 2',
...
'key_n' => 'Name n');
<? foreach (@choices as $key => $choice) {
echo "<input type="checkbox" name='keys[]' value='$key'/> $choice <br />";
} ?>
and I access the return values by:
$_POST['keys']
What if I want the $choices
array to be build from table data? How can I build a PHP array (which is good for building checkbox choices) from a table? Thanks