Advertisemen
Here is how to create down down menu with date and time for seven days.
<?php
$options = array();
$tm = new DateTime();
for($i=0;$i<7;++$i)
{
$options[$tm->getTimestamp()] = $tm->format("D, F j, Y");
$tm->modify("+1 day");
}
foreach ($options as $value => $label)
{
$daysWeek .= "<option value='$value'>$label</option>\n";
}
echo '<select>'.$daysWeek.'</select>';
?>
$options = array();
$tm = new DateTime();
for($i=0;$i<7;++$i)
{
$options[$tm->getTimestamp()] = $tm->format("D, F j, Y");
$tm->modify("+1 day");
}
foreach ($options as $value => $label)
{
$daysWeek .= "<option value='$value'>$label</option>\n";
}
echo '<select>'.$daysWeek.'</select>';
?>
Advertisemen
Tidak ada komentar:
Posting Komentar