title: PHP Multiple Checkbox Array
body: <p>I've looked around for a few examples here but a lot of them are either too advanced for my grasp of PHP or their examples are too specific to their own projects. I am currently struggling with a very basic part of a PHP form.</p>
  
  <p>I am trying to create a form with a few checkboxes, each assigned a different value, I want these to be sent to a variable (array?) that I can echo/use later, in my case I will be sending the checked values in an email.</p>
  
  <p>So far, I have tried a few variations, but the closest I have come to it is this...</p>
  
  <pre><code>&lt;form method='post' id='userform' action='thisform.php'&gt;
  &lt;tr&gt;
      &lt;td&gt;Trouble Type&lt;/td&gt;
      &lt;td&gt;
      &lt;input type='checkbox' name='checkboxvar' value='Option One'&gt;1&lt;br&gt;
      &lt;input type='checkbox' name='checkboxvar' value='Option Two'&gt;2&lt;br&gt;
      &lt;input type='checkbox' name='checkboxvar' value='Option Three'&gt;3
      &lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  &lt;input type='submit' class='buttons'&gt;
  &lt;/form&gt;
  
  &lt;?php
  $checkboxvar[] = $_REQUEST['checkboxvar'];
  ?&gt;
  </code></pre>
  
  <p>Where I'd echo $checkboxvar[] into my email.
  Am I going about this completely wrong? The other idea I had was to use a lot of if statements.</p>