<html>
<head>
<body>
<form action="result.php" method="POST">
<input type="checkbox" name="year[]" value="1">1
<input type="checkbox" name="year[]" value="2">2
<input type="checkbox" name="year[]" value="3">3 <br>
<input type="submit" name="btn_ok" value="ok">
</form>
</body>
</head>
</html>
result.php代码:
<?php
foreach ($_POST['year'] as $item)
{
echo $item." <br>";
}
?>