How can conditional statements, such as IF statements, be effectively used in PHP to manage select box options?

When managing select box options in PHP, conditional statements like IF statements can be used to dynamically generate the options based on certain conditions. For example, you can use IF statements to check if a certain condition is met and then display specific options in the select box accordingly.

<select name="select_box">
    <?php
    // Check if a condition is met
    if ($condition) {
        echo '<option value="option1">Option 1</option>';
        echo '<option value="option2">Option 2</option>';
    } else {
        echo '<option value="option3">Option 3</option>';
        echo '<option value="option4">Option 4</option>';
    }
    ?>
</select>