What is the best practice for deleting an entry from a dropdown list in PHP?

When deleting an entry from a dropdown list in PHP, the best practice is to remove the item from the array that populates the dropdown options and then refresh the dropdown list on the front end. This ensures that the deleted entry is no longer available for selection.

<?php
// Sample dropdown options array
$options = array("Option 1", "Option 2", "Option 3", "Option 4");

// Remove the entry "Option 3" from the dropdown options array
$key = array_search("Option 3", $options);
if($key !== false) {
    unset($options[$key]);
}

// Refresh the dropdown list on the front end
echo '<select>';
foreach($options as $option) {
    echo '<option>' . $option . '</option>';
}
echo '</select>';
?>