Answer the question
In order to leave comments, you need to log in
How to write if x = a or x = b?
if ( $x == $a or $x == $b )
if ( ($x == $a) or ($x == $b) )
if ( $x == ($a or $b) )
Answer the question
In order to leave comments, you need to log in
switch ($x) {
case $a:
case $b:
// делаем всякое
break;
default: // ничего не делаем
}
Just in case, I will draw your attention to the difference between "or" and "||": php.net/manual/en/language.operators.logical.php
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question