Limiting with conditional statements

For example, there is the following:

echo 1;
echo 2;
echo 3;
echo 4;

By what means is it possible to output only the first 2 echoes, i.e. 1 and 2?


Answer 1, authority 100%

<?php
$a = 1;
$b = 2;
if ($a+$a == $b) {
 echo 'fv allow';
} else {
if ($b-$a == $a-$a) {
 echo 'sv allow';
} else {
if ($a+$b*2 == 10) {
 echo 'tv allow';
}
}
}
?>

For example, we change the value of the variables so that different conditions are met.


Answer 2, authority 50%

remove
echo 3;
echo 4;
It’s obvious!


Answer 3

If you need to display 2 out of 4, then two are eliminated in any case according to some condition. And since there is a condition, then if

takes place