Blogger Information
Blog 21
fans 0
comment 0
visits 12347
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
foreach数组遍历————0417—04—22,21时42分
许增颜
Original
567 people have browsed it

代码如下:

实例

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>0417作业</title>
</head>
<body>
	
</body>
</html>
<?php 
echo '<p>选择你的生日</p>';
echo '<hr color="red">';
$years = range(1980,2000);
echo '<select name="year">';
foreach ($years as $value) {
	echo '<option value="'.$value.'">'.$value.'</option>';
}
echo '</select>';
echo '  ';

$months = range(1,12);
echo '<select name="month">';
foreach ($months as $value) {
	echo '<option value="'.$value.'">'.$value.'</option>';
}
echo '</select>';
echo '  ';
$days = range(1,30);
echo '<select name="day">';
foreach ($days as $value) {
	echo '<option value="'.$value.'">'.sprintf('%02d',$value).'</option>';
}
echo '</select>';
?>

运行实例 »

点击 "运行实例" 按钮查看在线实例

Correction status:qualified

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post