Complete the code to check if the number is positive.
<?php $number = 10; if ($number [1] 0) { echo "Positive number"; } ?>
The condition $number > 0 checks if the number is positive.
Complete the elseif condition to check if the number is zero.
<?php $number = 0; if ($number > 0) { echo "Positive number"; } elseif ($number [1] 0) { echo "Zero"; } ?>
The condition $number == 0 checks if the number is exactly zero.
Fix the error in the elseif condition to check if the number is negative.
<?php $number = -5; if ($number > 0) { echo "Positive number"; } elseif ($number [1] 0) { echo "Negative number"; } ?>
The condition $number < 0 checks if the number is negative.
Fill both blanks to complete the elseif ladder that prints the correct message based on the number.
<?php $number = 0; if ($number [1] 0) { echo "Positive number"; } elseif ($number [2] 0) { echo "Negative number"; } else { echo "Zero"; } ?>
The first condition checks if the number is greater than zero (positive). The elseif checks if it is less than zero (negative). Otherwise, it is zero.
Fill all three blanks to create an elseif ladder that prints the correct message for positive, negative, or zero values.
<?php $number = -3; if ($number [1] 0) { echo "Positive number"; } elseif ($number [2] 0) { echo "Negative number"; } elseif ($number [3] 0) { echo "Zero"; } ?>
The ladder checks if the number is greater than zero (positive), less than zero (negative), or equal to zero (zero).