i'm setting up a page with some 60 checkboxes on it. if the checkbox is set, the POST value for 'subcat', which is an array, will have one additional member in it.
something like:
<?
foreach($current_cat['subcats'] as $key=>$subcat) {
?>
<input type="checkbox" name="subcats[<?=$subcat['id'] ?>]" value="<?=$subcat['id'] ?>">
<?
} // each subcat
?>
if a user submits the form and there is some error, i want to make sure all the checkboxes previously selected are still selected (because there are TONS of them). So i'm going to need to add some logic to add 'checked' to a form input tag if the form was previously checked.
QUESTION: would this be faster:
if (in_array($subcat['id'], $_POST['subcats'])) echo ' checked';
or this:
if (isset($_POST['subcats'])) echo ' checked';