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

One common pitfall when using IF ELSE statements in PHP scripts is forgetting to include the necessary curly braces {} for each block of code within the statement. This can lead to unexpected behavior and errors in your script. To avoid this issue, always remember to use curly braces to define the code blocks for both the IF and ELSE conditions.

// Incorrect usage of IF ELSE statement without curly braces
if ($condition)
    echo "Condition is true";
    echo "This will always be executed, regardless of the condition";

// Corrected IF ELSE statement with curly braces
if ($condition) {
    echo "Condition is true";
} else {
    echo "Condition is false";
}