Last active
December 18, 2015 07:39
-
-
Save dcblogdev/5747856 to your computer and use it in GitHub Desktop.
drop down next 3 days of before 8am show only today.
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 | |
date_default_timezone_set('Europe/London'); | |
$m= date("m"); | |
$de= date("d"); | |
$y= date("Y"); | |
?> | |
<select name'dates'> | |
<?php | |
if(date('H') < '8'){ | |
for($i=0; $i<3; $i++){ | |
echo '<option value="'.date('d-m-Y',mktime(0,0,0,$m,($de+$i),$y)).'">'.date('d-m-Y',mktime(0,0,0,$m,($de+$i),$y)).'</option>'; | |
} | |
} else { | |
for($i=1; $i<4; $i++){ | |
echo '<option value="'.date('d-m-Y',mktime(0,0,0,$m,($de+$i),$y)).'">'.date('d-m-Y',mktime(0,0,0,$m,($de+$i),$y)).'</option>'; | |
} | |
} | |
?> | |
</select> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment