I have the following statement
if ( !(strstr($Description1,'word1') OR strstr($Description1,'word2') OR
strstr($Description2,'word1') OR strstr($Description2,'word2') OR
strstr($Description3,'word1') OR strstr($Description3,'word2') OR
strstr($Description4,'word2') OR strstr($Description4,'word2') OR
($_POST['fine'] == x) OR ($_POST['fine'] == y) OR ($_POST['fine'] == z))) {
Action1
} else {
Action2
}
What it does if any of the statements is true it goes to Action2
. What I want it to do is that if any the statements is true go to Action1
Keep the "or" bits within one set of brackets.
if ($a == "a" || $b == "b"){ Action1} else { Action2}
why not just remove the !
at the beginning or just switch action1
and action2
??
if ((strstr($Description1,'word1') OR strstr($Description1,'word2') OR
strstr($Description2,'word1') OR strstr($Description2,'word2') OR
strstr($Description3,'word1') OR strstr($Description3,'word2') OR
strstr($Description4,'word2') OR strstr($Description4,'word2') OR
($_POST['fine'] == x) OR ($_POST['fine'] == y) OR ($_POST['fine'] == z))) {
Action1
} else {
Action2
}
or
if ( !(strstr($Description1,'word1') OR strstr($Description1,'word2') OR
strstr($Description2,'word1') OR strstr($Description2,'word2') OR
strstr($Description3,'word1') OR strstr($Description3,'word2') OR
strstr($Description4,'word2') OR strstr($Description4,'word2') OR
($_POST['fine'] == x) OR ($_POST['fine'] == y) OR ($_POST['fine'] == z))) {
Action2
} else {
Action1
}