Hello and welcome, the answer is easier than you think...
1 = True
(NULL) = False
Try changing the numbers you will see you still get 1 or NULL
Which means the variable $less will be 1 or nothing at all
Hope that clears it up for you
Examples...
Code:
<?php
$a = 10;
$b = 20;
// Check $a less than $b
$less = ($a < $b);
// If $a is not equal to 1 (TRUE), show a message
if ($less != 1)
{
echo "NULL\n";
// we need to exit to program
exit();
}
echo $less . " TRUE\n";
?>
swapping the numbers round would normally produce nothing for the "echo" statement to write so for an example you could use another boolean operative to display a message if the answer is NULL..
Code:
<?php
$a = 20;
$b = 10;
// Check $a less than $b
$less = ($a < $b);
// If $a is not equal to 1 (TRUE), show a message
if ($less != 1)
{
echo "NULL\n";
// we need to exit to program
exit();
}
echo $less . " TRUE\n";
?>
This snippet would echo "NULL" as the statement
is true, as $a "is not equal to" 1
P.S.
I have changed $one to $a and $two to $b
I don't believe it's a codeing practice thing, but it's the way I was taught, not to use written numbers as variables as it makes the code harder to read in a way, if you use a similar format to algebra type equations you automatically (sic) can read it easier. (I know I can)