i m new to php and coding is old school
<?php
for($i=-2; $i<count($s2)-1;$i++){ ?>
<tr>
<td>
<?php
switch ($i) {
case '-2':
echo "JR KG";
goto a;
break;
case '-1':
echo "SR KG";
break;
case '0':
echo "Nursery";
break;
default:
echo $i;
?>
</td>
<?php foreach($a2 as $aaa){ a: ?>
<td>
<input type="checkbox" name="<?php echo $aaa.'['.$i.']'; ?>" >
</td>
<?php
}
?>
</tr>
<?php
}
}
?>
by above code i wanted to display list of standard and display a checkbox for each division (a-h). after printing standard i want to display the grid like checkboxs. this works for i= 1 to 12.. fails for -2,-1,0 because of break();
so i tried adding a goto a; but getting following error
Fatal error: 'goto' into loop or switch statement is disallowed in
any suggestions how to get the checkboxes for each division for the 1st three fields.
with the loop of "i" i am starting a row that display standard, and with the loop of "foreach($a2)" i am want to append number of checkboxes foreach divison in $a2.. want to create like a grid. its failing to append the checkboxes in first 3 rows because of break()
thanks.