What is the purpose of the if-elseif-else structure in PHP?

The if-elseif-else structure in PHP allows us to execute different blocks of code based on different conditions. This is useful when we have multiple conditions to check and want to perform different actions depending on which condition is true. By using if-elseif-else, we can streamline our code and make it more readable and organized.

$number = 10;

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