title: PHP checkbox validation checked or not checked
body: <p>I've been using similar code to this for my project and I'm able to get all of the &quot;Checked&quot; checkboxes using the $_POST[]. However, I also need to get the value of the unchecked checkboxes since this form is dynamically being built and the number of checkboxes may vary as well as change state from checked to unchecked and vice versa.</p>
  <pre><code>&lt;form method='post' action=''&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 
  if (isset($_POST['checkboxvar'])) 
  {
      print_r($_POST['checkboxvar']); 
  }
  ?&gt;
  </code></pre>
  <p>I've seen some suggestions using <strong>!isset($_POST[ ])</strong> but I'm not certain on how that would work or if that is even a solution for the problem.</p>
  <p>Any help would be appreciated.</p>