php if with 1 or 0 code example
Example 1: php inline if
/* most basic usage */
$var = 5;
$var_is_greater_than_two = ($var > 2 ? true : false); // returns true
Example 2: php if elseif
$a = random_int(0, 10);
$b = random_int(0, 10);
if ($a > $b) {
echo 'a is greater than b';
} elseif ($a == $b) {
echo 'a is equal to b';
} else {
echo 'a is less than b';
}