title: how to check checkboxes whether they are empty or not
body: <p>I apologize if it is stupid question. I wanted to check whether one or more checkboxes are not empty, then can process the form and print interest text for email. </p>
  
  <p><code>HTML/PHP</code></p>
  
  <pre><code>&lt;p&gt;&lt;label for="commentsText"&gt;I am interested in:&lt;/label&gt;&lt;br/&gt;
  &lt;input type="checkbox" name="interest[]" id="interest" value="1" class="required requiredField email" /&gt; 
      Exhibiting. Please send me more information&lt;br/&gt;
  &lt;input type="checkbox" name="interest[]" id="interest" value="2" class="required requiredField email" /&gt; 
      Visiting. Please add me to your mailing list&lt;br/&gt;
  &lt;input type="checkbox" name="interest[]" id="interest" value="3" class="required requiredField email" /&gt; 
      Speaking. Please send me more information&lt;br/&gt;
  &lt;input type="checkbox" name="interest[]" id="interest" value="4" class="required requiredField email" /&gt; 
      Attending. Please send me more information&lt;br/&gt;
  
  &lt;?php if($interestError != '') { ?&gt;
  &lt;span class="error"&gt;&lt;?php echo $interestError; ?&gt;&lt;/span&gt;
  &lt;?php } ?&gt;
  &lt;/p&gt;
  </code></pre>
  
  <p><code>PHP</code></p>
  
  <pre><code>$interest='';    
  if(empty($_POST[$interest]))
  { 
      $interestError ='Please select the interests';
      $hasError = true;
  }
  else{
      $numberofInterest = count($interest);
      for ($i=0; $i &lt; $numberofInterest; $i++)
      {
          $numofInterest = $interest[i];
          echo $numofInterest . " ";
      }
  }
  </code></pre>
  
  <p><strong>EDIT #2</strong></p>
  
  <p>Thank you everybody for the help. I used print_r and saw all four are printed. The problem is now: if no error, send mail. It doesn't show all when I checked all checkboxes. Only displays '4'. Is there a way to display all including texts? </p>
  
  <pre><code>if(!isset($hasError)) {
  
          $interest = $numofInterest ;
  
      $subject = 'I Have A Question to Ask from '.$name;
              $thanksubject = 'Thank you for the Form Submission';
              $body = "Name: $name \n\nEmail: $email \n\nInterest: $interest\n\nComments: $comments";
  </code></pre>
  
  <p><strong>*<em>EDIT #3</em>*</strong></p>
  
  <p>OK I have solved that last one above. managed to send email with everything. </p>