I have never used foreach becuase I have never fully understand it. However I am at a point where I think foreach is the best possible way to accomplish this task. I have a page which lists equipment and each row has a checkbox for deletion. This table is dynmacially long so there is no set length on number of checkboxes. I used a trick I read on these forums (either Jpadies or Sleipnir's) so that all my checkboxes are are named "Delete[$i]" basically dunmically populated with the right numbers, and the post arry reads the deletes as an array. The thing is I'd like these checkboxes stored as booleans, 1 or 0, so here is my attempt.
However, that does not seem to work. If someone could help me out it'd be much appreciated. I am not sure of how the value part works. I tried using an &$Value but it doesn't seem to want to work.
Code:
foreach($Delete as $Value){
if($Value == "on")
$Value = 1;
else
$Value = 0;
}