What are best practices for structuring IF statements in PHP to ensure proper functionality?

When structuring IF statements in PHP, it is important to ensure proper functionality by following best practices such as using clear and concise conditions, avoiding nested IF statements whenever possible, and properly formatting the code for readability. By adhering to these guidelines, you can make your code more maintainable and easier to debug.

// Example of a well-structured IF statement in PHP
$number = 10;

if ($number > 0 && $number < 20) {
    echo "The number is between 0 and 20.";
} elseif ($number >= 20) {
    echo "The number is 20 or greater.";
} else {
    echo "The number is negative.";
}