What potential pitfalls can arise when using if-else statements in PHP scripts?
One potential pitfall when using if-else statements in PHP scripts is not properly handling all possible conditions, leading to unexpected behavior or errors. To avoid this, make sure to include an else statement to catch any conditions not covered by the if statement.
$number = 10;
if ($number > 10) {
echo "Number is greater than 10";
} else {
echo "Number is 10 or less";
}