With the use of the switch statement you can check for all these conditions at once. The way the Switch statement works is it takes a single variable as input and then checks it against all the different cases you set up for that switch statement.
Example
<?php
switch ($y)
{
case 1:
echo "y equals to 1";
break;
case 2:
echo "y equals to 2";
break;
case 3:
echo "y equals to 3";
break;
default:
echo "y is not equals to 1, 2 or 3";
}
?>