0
There is another way to develop this comparison?
$numero = 1234;
$a = 1111;
$b = 2222;
$c = 3333;
$d = 4444;
if ($numero == $a or $numero == $b or $numero == $c or $numero == $d) {
echo "O número existe";
} else {
echo "Não existe o número";
}
I wonder if there’s another way to manipulate that comparison
($numero == $a or $numero == $b or $numero == $c or $numero == $d)
Beware the difference between
or
and||
is the priority. see manual logical operators– rray
In the original code the variables receive the values
$numero = 0.00005670;
$a = 0.00008756;
$b = 0.00006745;
$c = 0.00006754;
$d = 0.00008734;
What’s the difference? The two wouldn’t work the same way in this situation?– user3486019