I noticed that PHP seems to return only values of checked checkboxes. I would like to see a list of checkboxes, not just values of checked checkboxes. Is there a way to dete
Suppose you have a 3 checkboxes you want to check, and update_settings is the name of your functions that take the checkbox name as a first argument and a bool value as a second one (activate or not).
Take the following snippet:
$checkboxes = array("checkbox1", "checkbox2", "checkbox3");
foreach($checkboxes as $checkbox){
$checked = isset($_POST[$checkbox]);
update_settings($checkbox, $checked);
}
Althouth Peter Kovacs solution it's going to work, I don't think it's practical since you can already check your variables using isset.