What best practices should be followed when using if statements in PHP?

When using if statements in PHP, it is important to follow best practices to ensure clean and efficient code. Some best practices include using strict comparison operators (=== and !==) instead of loose comparison operators (== and !=), avoiding nested if statements whenever possible, and using elseif instead of multiple if statements for better readability.

// Example of using strict comparison operator and elseif statement
$number = 10;

if ($number === 10) {
    echo "Number is equal to 10";
} elseif ($number > 10) {
    echo "Number is greater than 10";
} else {
    echo "Number is less than 10";
}