How can nested if-else statements in PHP be structured to avoid unexpected parse errors?

Nested if-else statements in PHP can sometimes lead to unexpected parse errors if not structured properly. To avoid this issue, it is important to maintain proper indentation and use curly braces to clearly define the scope of each if-else block. This helps PHP interpreter to correctly parse the code and avoid any unexpected errors.

// Example of nested if-else statements with proper structure to avoid parse errors
$score = 85;

if ($score >= 90) {
    echo "Excellent";
} else {
    if ($score >= 80) {
        echo "Good";
    } else {
        echo "Needs Improvement";
    }
}