How can the flexibility and reusability of code be improved when creating dropdown menus with future years in PHP?

When creating dropdown menus with future years in PHP, the flexibility and reusability of the code can be improved by dynamically generating the list of years based on the current year. This way, the dropdown menu will always display the current year as the first option, and future years can be easily added without manually updating the code each year.

<select name="year">
    <?php
    $currentYear = date("Y");
    for ($i = $currentYear; $i <= $currentYear + 10; $i++) {
        echo "<option value='$i'>$i</option>";
    }
    ?>
</select>