How can whitespace and formatting be used to improve the readability of complex if-else statements in PHP?

Complex if-else statements in PHP can be difficult to read and understand, especially when they involve multiple conditions and nested structures. By using proper whitespace and formatting, such as indenting code blocks and aligning braces, the structure of the if-else statements can be made more visually clear and easier to follow.

if ($condition1) {
    // code block for condition1
} elseif ($condition2) {
    // code block for condition2
} else {
    // default code block
}