This page has a list of week, user can check different day for different week
<input type="checkbox" name="week[]" value="Sun"/>
Sun
<input type="checkbox" name="week[]" value="Mon"/>
Mon
<input type="checkbox" name="week[]" value="Tue"/>
Tue
<input type="checkbox" name="week[]" value="Wed"/>
Wed
<input type="checkbox" name="week[]" value="Thu"/>
Thu
<input type="checkbox" name="week[]" value="Fri"/>
Fri
<input type="checkbox" name="week[]" value="Sat"/>
Sat
<br/>
<br/>
<input type="checkbox" name="week[]" value="Sun"/>
Sun
<input type="checkbox" name="week[]" value="Mon"/>
Mon
<input type="checkbox" name="week[]" value="Tue"/>
Tue
<input type="checkbox" name="week[]" value="Wed"/>
Wed
<input type="checkbox" name="week[]" value="Thu"/>
Thu
<input type="checkbox" name="week[]" value="Fri"/>
Fri
<input type="checkbox" name="week[]" value="Sat"/>
Sat
<br/>
<br/>
.
.
.
<!-- can dynamically add more by javascript -->
But after submit, the all day will be combined in a 1D array
So I change week[] to week[][]
But it still combine all value in a 1D array, and each element of this array is an array
How to submit two dimension checkbox?
I expect I can use this to loop through all weeks and days, I don't want to hard code sequence number to weeks.
foreach ($week as $oneWeek)
{
echo 'week<br>';
foreach ($oneWeek as $day)
{
echo $day.'<br>';
}
}