What is the purpose of using the IF-Selektion in PHP and what are common pitfalls when implementing it?

The purpose of using the IF-Selektion in PHP is to conditionally execute certain code based on a specified condition. Common pitfalls when implementing it include forgetting to properly structure the if-else statements, not using the correct comparison operators, and not considering all possible outcomes.

// Example of using IF-Selektion in PHP
$number = 10;

if ($number > 0) {
    echo "The number is positive.";
} elseif ($number < 0) {
    echo "The number is negative.";
} else {
    echo "The number is zero.";
}