$check = $_POST['check'];
for($i=0;$i<count($check);$i++)
echo $check[$i]; // $check[$i] 为被选中的checkbox的value,未选中的不被提交
for($i=0;$i<count($check);$i++)
echo $check[$i]; // $check[$i] 为被选中的checkbox的value,未选中的不被提交
$a = count($check);//输出是0,也就是说没有把选中的添加到数组当中去
<?php
$check = $_POST['check'];
print_r($check);
echo count($check);?>
<form action="" method=post>
<input type=checkbox name="check[]" value=1>
<input type=checkbox name="check[]" value=2>
<input type=checkbox name="check[]" value=3>
<input type=checkbox name="check[]" value=4>
<input type=checkbox name="check[]" value="">
<input type=submit>
</form>
echo $_POST['check'][0];
<?php
$check = $_POST['check'];
print"<pre>";
print_r($_POST['check']);
print"</pre>";
print $_POST['check'][0];
?>
<form action="" method=post>
<input type=checkbox name="check[]" value=1>
<input type=checkbox name="check[]" value=2>
<input type=checkbox name="check[]" value=3>
<input type=checkbox name="check[]" value=4>
<input type=checkbox name="check[]" value="">
<input type=submit>
</form>