I want to parse this 'array' of id's
If you want an array, then you have to change the 'name' attribute to 'id[]' instead of 'id'. When this form is submitted, you will have an array variable $id which contains the value of checkboxes that are checked. If the name is 'id', then you will have a variable which only contains the value of the last checked checkbox. Change it like this :
Code:
echo "<input type=checkbox name=\"id[]\" value=\"". $id . "\">";
After you submit the form, you can access these values using loop :
Code:
for($i=0; $i<count($id); $i++) {
// do something with $id[$i]
}
Bookmarks