Created
July 17, 2018 06:59
-
-
Save phpfiddle/8db9b31f476ffc583e025fd8f18f46e0 to your computer and use it in GitHub Desktop.
[ Posted by Muhammadali ] Code for asif
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
<?php | |
$months = array( | |
1 => 'Jan', | |
2 => 'Feb', | |
3 => 'March', | |
4 => 'April', | |
5 => 'May', | |
6 => 'June', | |
7 => 'July', | |
); | |
$currentMonth = (int)date('m'); | |
$someVar = "123k"; | |
echo $someVar; | |
echo (int)$someVar; | |
?> | |
<select> | |
<option value="">Select Month</option> | |
<?php foreach ($months as $key => $month): ?> | |
<option value="<?php echo $key; ?>" <?php echo $key == $currentMonth ? 'selected' : '' ?>><?php echo $month; ?></option> | |
<?php endforeach; ?> | |
</select> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment