利用php创建日期选择框
程序员文章站
2022-05-19 08:50:22
...
<form action="" method="post" > <?php $months = array (1 => 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'); $days = range(1,31); $years = range(2008,2018); echo '<select name="month" >'; foreach ($months as $key => $value) { echo "<option value=\"$key\">$value</option>"; } echo '</select>'; echo '<select name="day" >'; foreach ($days as $value) { echo "<option value=\"$value\">$value</option>"; } echo '</select>'; echo '<select name="year" >'; foreach ($years as $value) { echo "<option value=\"$value\">$value</option>"; } echo '</select>'; ?> </form>
上一篇: mysql 视图怎么增加自增字段