What are the best practices for displaying a list of colors in a drop-down menu using PHP?

When displaying a list of colors in a drop-down menu using PHP, it is best to store the colors in an array and then loop through the array to generate the options for the drop-down menu. This allows for easy maintenance and customization of the color options.

<?php
// Array of colors
$colors = array("Red", "Blue", "Green", "Yellow", "Purple");

// Display drop-down menu
echo '<select name="color">';
foreach ($colors as $color) {
    echo '<option value="' . $color . '">' . $color . '</option>';
}
echo '</select>';
?>