title: can we use goto statement within the switch statement? in php
body: <p>i m new to php and coding is old school</p>
  
  <pre><code>&lt;?php
    for($i=-2; $i&lt;count($s2)-1;$i++){ ?&gt;
    &lt;tr&gt;
      &lt;td&gt;
      &lt;?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;
      ?&gt;
      &lt;/td&gt;
      &lt;?php foreach($a2 as $aaa){  a: ?&gt;
      &lt;td&gt;
          &lt;input type="checkbox" name="&lt;?php echo $aaa.'['.$i.']'; ?&gt;" &gt;
      &lt;/td&gt;
      &lt;?php
         }
      ?&gt;                              
  &lt;/tr&gt;
  &lt;?php
     }
  }
  ?&gt;
  </code></pre>
  
  <p>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();</p>
  
  <p>so i tried adding a goto a; but getting following error</p>
  
  <p><strong>Fatal error: 'goto' into loop or switch statement is disallowed in</strong></p>
  
  <p>any suggestions how to get the checkboxes for each division for the 1st three fields.</p>
  
  <p>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()</p>
  
  <p>thanks.</p>