I have these fields: weight, size_1, size_2, size_3
How can I check so minimum one of these fields are filled.
If its under the minimum then it should output “Error, fill one atleast”
I can do this with long if statements, that checks for empty, but is their a better way?
The fields come from an form submission, so it looks like this to get them:
$_POST['weight'];
$_POST['size_1'];
$_POST['size_2'];
$_POST['size_3'];
Assuming they are all in an array:
Use it like so:
Update with filter:
Assuming they are all in an array:
Use it like so: