user6509972 user6509972 - 4 months ago 16
PHP Question

Php form isset with multiple brackets

I have a check box with a name of:

<input type='checkbox' name ='schedule[".$row['id']."][1]' />


I want to check if that check box was selected with a PHP isset(...). I tried isset($_POST['schedule[".$row['id']."][1]]);

But that didn't work. Any ideas on how I could do this?

Answer

Try it like:

isset($_POST['schedule'][$row['id']][1])

Simply treat it as multi-D array in this case and edit particular index of schedule key.

Comments