I have two ifs
that take into account 3 conditions, one of them with multiple possibilities.
I'm doing this, but it's not working:
if (($var1 == $var2) && ($var3 == 1 || 3 || 5 || 7 || 8 || 12) && ($var4 > 16)) {
$var5--;
}
if (($var1 == $var2) && ($var3 == 4 || 6 || 9 || 11) && ($var4 > 15)) {
$var5--;
}
In my tests the script is always taking 2 of $var5
, when it was to remove only 1, because $var3
will never match in both cases. So I guess he's not considering this condition. I've already researched here, and all the examples I've found show at most two conditions.
What is the correct way to declare various conditions within a if
, some of these conditions may have multiple possibilities and use other operators within the condition ( $var3
in the above example). Thanks in advance.