I have a form that allows users to select from a list of cities in options. I use a foreach() approach to automatically populate the options with all cities in the database, The problem is that I am not sure how to get the results to sort alphabetically.
Here is the code so far without any sorting:
 City:
 <select name="city">
 <option value="" selected="selected">Any</option>
 <?php foreach($city_list as $city) : ?>
 <option><?php echo $city; ?></option>
 <?php endforeach; ?>
 </select>
 
     
    