How can proper indentation and formatting of code enhance the clarity of nested if-else statements in PHP?

Proper indentation and formatting of code can enhance the clarity of nested if-else statements in PHP by visually representing the hierarchy of the conditions. This makes it easier for developers to understand the logic flow and quickly identify which code block belongs to which condition. To improve readability, each nested if-else block should be indented consistently, with braces aligned properly.

if ($condition1) {
    if ($condition2) {
        // Code block for condition1 and condition2
    } else {
        // Code block for condition1 only
    }
} else {
    // Code block for outer else condition
}