Created
March 26, 2019 11:24
-
-
Save jgarciaruiz/64091b703e66641186377dd4a807fa56 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<select name="month" id="month" class="select_month"> | |
<?php | |
for ($i = 1; $i <= 12; $i++){ | |
$monthNumber = ($i < 10) ? '0'.$i : $i; | |
$monthStr = date('F', strtotime("$currentYear-$monthNumber")); | |
echo '<option value="'.$monthNumber.'"'; | |
if ($i == $currentMonth){ | |
echo ' selected="selected"'; | |
} | |
echo '>'.$monthStr.'</option>'; | |
} | |
?> | |
</select> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment