<input type='hidden' name='var[name1]' value='1'>
<input type='hidden' name='var[name2]' value='1'>
<input type='hidden' name='var[name3]' value='1'>
<input type='hidden' name='var[name4]' value='1'>
<input type='hidden' name='var[name5]' value='1'>
Now, if I need to get all these values I can use foreach using $_POST['var'].
In some situations I need to get only some of these inputs say, 'name2' and 'name5' and $_POST['var[name2]'] and $_POST['var[name5]'] will not work.
What logic can be used in this scenario?
foreach$_POST['var']. Why notprint_r()that variable and see its contents for yourself?