今月の日にちをドロップダウンに表示


<?php
date_default_timezone_set('Asia/Tokyo');
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>LECTURE1-2.2の練習問題</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div id="wrap">
<div id="head">
<h1>LECTURE1-2.2の練習問題</h1>
</div>
<div id="content">
<div style="margin-top: 200px">
<form action="" method="get">
<dl>
<dt>日にち</dt>
<dd>
<?php print(date('n')); ?><select name="day" id="day">
<?php
$day = 1;
while ($day<=date('t')) {
print('<option value="' . $day . '">' . $day . '日</option>');
$day++;
}
?>
</select>
</dd>
</dl>
<input type="submit" value="送信する">
</form>
</div>
</div>
</div>
</body>
</html>