What are common pitfalls when using IF/ELSE IF statements in PHP?

One common pitfall when using IF/ELSE IF statements in PHP is forgetting to include an ELSE statement at the end to catch any cases that do not meet the conditions of the preceding IF and ELSE IF statements. To solve this issue, always include an ELSE statement to handle any remaining cases.

$number = 10;

if ($number > 10) {
    echo "Number is greater than 10";
} elseif ($number < 10) {
    echo "Number is less than 10";
} else {
    echo "Number is equal to 10";
}