I am using PHP to create a dropdown box with years from 1900 to 2012. However, I'd like to have 2012 at the top of the list (i.e. count down from 2012 to 1900 instead of up from 1900 to 2012).
Any help you can provide would be great! :)
<select id="year">
<option value="">----</option>
<?
for ($i = 1900; $i <= 2012; $i++){
echo '<option value="'.$i.'">'.$i.'</option>';
}
?>
</select>
for($i = 2012; $i >= 1900; $i--)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With