PHP Percolate! Season 6 (19 Chapters)

Student: Jim Merrikin

script 2.9 - calendar_2.php

OUTPUT:

CODE:

<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<title>J. Merrikin - 2.8 Sorting Arrays</title>
		<link rel="stylesheet" type="text/css" href="../common.css" />
	</head>
	<body>
		<?php
			$months = array (1 => 'January', 'February', 'March', 'April', 'May', 'June', 
			'July', 'August', 'September', 'October', 'November', 'December');


			echo '<select name="month">';
			foreach ($months as $key => $value) {
				echo "<option value=\"$key\"> $value</option>\n";
			}
			echo '</select>';

			echo '<select name="day">';
			for ($day = 1; $day <= 31; $day++) {
				echo "<option value=\"day\">$day</option>\n";
			}
			echo '</select>';

			echo '<select name="year">';
			for ($year = 2011; $year <= 2021; $year++) {
				echo "<option value=\"$value\">$year</option>\n";
			}
			echo '</select>';
		?>
	</body>
</html>