somebody help me please,
<?php if ($_POST['jobs'] == 6 || 7 || 8 || 9 && $_POST['sex'] = 'L') {*true statement*} ?>
it is correct? CMIIW. someone please explain how to write if else with array condition. Thanks
somebody help me please,
<?php if ($_POST['jobs'] == 6 || 7 || 8 || 9 && $_POST['sex'] = 'L') {*true statement*} ?>
it is correct? CMIIW. someone please explain how to write if else with array condition. Thanks
I'd advise you to check out the in_array function.
$jobs = array('6', '7', '8', '9');
if (in_array($_POST['jobs'], $jobs) && $_POST['sex'] == 'L')
{
//Do something.
}