PHP支持多维请求参数。但是你需要改变表单结构。我给你一个简单的例子:
<?php
if(isset($_POST) && isset($_POST['example_checkbox'])) {
foreach($_POST['example_checkbox'] as $key => $value) {
echo "The balue of $key is $value<br />";
}
exit;
}
?>
<html>
<head>
<title>Example</title>
</head>
<body>
<form method="post">
<input type="checkbox" name="example_checkbox[checkbox_1]" value="1" />1<br />
<input type="checkbox" name="example_checkbox[checkbox_2]" value="2" />2<br />
<input type="checkbox" name="example_checkbox[checkbox_3]" value="3" />3<br />
<input type="checkbox" name="example_checkbox[checkbox_4]" value="4" />4<br />
<input type="checkbox" name="example_checkbox[checkbox_5]" value="5" />5<br />
<input type="checkbox" name="example_checkbox[checkbox_6]" value="6" />6<br />
<input type="submit" />
</form>
</body>
</html>
化妆复选框作为阵列 2014-12-13 08:28:03
,让我错误..无效的论据等等等等等等 – 2014-12-13 08:29:04
检查它我现在提交 – 2014-12-13 08:39:40