I have about 40 items in my FORM
and i'm trying to give all the Name=
properties a variable for process without having to write each out manually. am I missing something here, cause the code below is not working. (name="comp1", name="comp2"... $comp1, $comp2)
$en = array_merge($em, $_POST);
$valid = true;
foreach($_POST as $value) {
if(!isset($value)) {
$valid = false;
}
}
If something is not in $_POST
, the foreach will not loop through it. Isset()
will always return true, because the foreach loops through all values in $_POST
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With