Im trying to throw something together in PHP. I can’t seem to get this simple bit to work.
The result I want is if $x = 4, 5, or 6 the output should be hello x is (the value of $x)
here is the code:
<?php
$x = 1;
if ($x != 4 || $x != 5 || $x != 6)
{echo "hello ";
echo "x is $x";}
?>
In the example above the output is “hello x is 1”
however if I change the first line of the code to $x = 4 the expected output is “hello x is 4” when the output should be blank.
Thanks,
Chris
You have the opposite logic. You need