title: checkbox htmlentities() expects parameter 1 to be string, array given
body: <p>I'm using htmlentities() in a controller:</p>
  
  <pre class="lang-php prettyprint-override"><code>foreach ($_POST as $key =&gt; $value) {
      $_POST[$key] = htmlentities($value);
  }
  </code></pre>
  
  <p>I have a table with a checkbox, and I want to delete multiple items using checkbox but I get this error:</p>
  
  <blockquote>
    <p>htmlentities() expects parameter 1 to be string, array given.</p>
  </blockquote>
  
  <p>posting the form gives this data:</p>
  
  <pre><code>array(3) { 
      ["submit-button"]=&gt; string(0) "" 
      ["records"]=&gt; NULL 
      [1]=&gt; string(1) "1" 
  }
  </code></pre>
  
  <p>When I remove the above code, posting the form gives this data:</p>
  
  <pre><code>array(3) { 
      ["submit-button"]=&gt; string(0) "" 
      ["records"]=&gt; array(2) { 
          [0]=&gt; string(1) "1" 
          [1]=&gt; string(1) "3" } 
      [1]=&gt; string(1) "1" 
  }
  
  </code></pre>
  
  <p>So htmlentities can't read records as array.
  What can I do? </p>