我有一段代码如下:
<td><?
$days = array("Sun","Mon","Tue","Wed","Thur","Fri","Sat");
for($i=1;$i<8;$i++)
{
echo $days[$i-1]?><input type="checkbox" name="labDays[]" value="<?=$days[$i]?>" checked="checked"><?
}?>
</td>
但是,当我跑步时print_r($_REQUEST['labDays']);
我明白了Array ( [0] => [1] => [2] => [3] => [4] => [5] => [6] => )
我期望Array ( [0] => Sun[1] => Mon[2] => Tue[3] => Wed[4] => Thur[5] => Fri[6] => Sat)
我确定这很愚蠢,但我不确定我错过了什么......
print_r($_REQUEST)
呕吐物:Array ( [pg] => 12 [msg] => Facility Already Exist [facilityname] => kjgkjhgkjhg [facorgtype] => [facilitytype] => [administratorsname] => [divisionname] => [streetaddress1] => [streetaddress2] => [city] => [state] => [zipcode] => [phonenumber] => [faxnumber] => [email] => [mainstate] => [labDays] => Array ( [0] => [1] => [2] => [3] => [4] => [5] => [6] => ) [facBillingContact] => [facBillingPhone] => [facBillingFax] => [facBillingRep] => [facBillingAccNum] => [facNotes] => [submit] => Create )
var_dump($_REQUEST['labDays'])
:
array
0 => string 'Sun' (length=3)
1 => string 'Mon' (length=3)
2 => string 'Tue' (length=3)
3 => string 'Wed' (length=3)
4 => string 'Thur' (length=4)
5 => string 'Fri' (length=3)
6 => string 'Sat' (length=3)