title: PHP checkbox form retrieval, tried all stackoverflow solutions
body: <pre><code>&lt;table&gt;
                              &lt;col width="250"&gt;
                              &lt;col width="250"&gt;
                              &lt;col width="250"&gt;
                              &lt;tr&gt;&lt;td&gt;
                                      &lt;input type="checkbox" name="toppings[]"/&gt;Pepperoni&lt;br&gt;
                                      &lt;input type="checkbox" name="toppings[]"/&gt;Mushroom&lt;br&gt;
                                      &lt;input type="checkbox" name="toppings[]"/&gt;Bacon
                                  &lt;/td&gt;
  
                                  &lt;td&gt;
                                      &lt;input type="checkbox" name="toppings[]"/&gt;Onion&lt;br&gt;
                                      &lt;input type="checkbox" name="toppings[]"/&gt;Tomatoes&lt;br&gt;
                                      &lt;input type="checkbox" name="toppings[]"/&gt;Olives
                                  &lt;/td&gt;
  
                                  &lt;td&gt;
                                      &lt;input type="checkbox" name="toppings[]"/&gt;Pineapple&lt;br&gt;
                                      &lt;input type="checkbox" name="toppings[]"/&gt;Green Pepper&lt;br&gt;
                                      &lt;input type="checkbox" name="toppings[]"/&gt;Extra Cheese
                                  &lt;/td&gt;
                              &lt;/tr&gt;
                          &lt;/table&gt;
  
  $toppings = isset($_POST["toppings[]"]) ? $_POST["toppings[]"] : array("");
  foreach($toppings as $chk =&gt; $selection){
      echo $selection . ", ";
  }
  </code></pre>
  
  <p>/*<br>
      For what ever reason my $selection value is always empty. The most I have ever gotten to print was the word "on" which would only be on if at least one of the checkboxes were checked off. I have attempted over 30 different solutions to iterating through checkbox arrays, but nothing seems to work. What am I doing wrong?</p>
  
  <pre><code>Sorry for the poorly formatted code, and thanks in advance for the help.
  </code></pre>
  
  <p>*/</p>