代码如下 | 复制代码 |
<html> <head> <title>获取复选框的值</title> </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" value="提交" /> |
php代码
代码如下 | 复制代码 |
<?php foreach($_POST['year'] as $item){ echo $item."<br>"; } ?> |
时间: 2024-09-23 02:36:48