if ($condition) {
    # Code to execute if the condition is true
} elseif ($anotherCondition) {
    # Code to execute if the second condition is true
} else {
    # Code to execute if no conditions are true
}

switch ($variable) {
    'Condition1' {
        # Code for Condition1
        break
    }
    'Condition2' {
        # Code for Condition2
        break
    }
    default {
        # Default code block
    }
}


Ultime modifiche: sabato, 20 aprile 2024, 12:15