title: PHP: How to save multiple checkbox array from $_POST in variable
body: <p>I am new to PHP and am looking for some help with the following:</p>
  
  <p>I have a large HTML form with various inputs, selects and textareas. On submit I <strong>pass all field values to another PHP page</strong> to create an email with them. </p>
  
  <p><strong>This works</strong> as intended for text inputs, radio buttons, selects, textareas etc. <strong>but not for checkboxes</strong>. </p>
  
  <p>In the form I have multiple checkboxes that all look as follows using the same name: </p>
  
  <pre><code>&lt;input type='checkbox' class='someClass' id='language1' name='language[]' value='de - German' /&gt;
  &lt;input type='checkbox' class='someClass' id='language2' name='language[]' value='en - English' /&gt;
  &lt;input type='checkbox' class='someClass' id='language3' name='language[]' value='fr - French' /&gt;
  &lt;!-- ... --&gt;
  </code></pre>
  
  <p>On the PHP side I tried the following but if I then use <code>$languages</code> for my email body it shows as blank (while all other fields appear correctly): </p>
  
  <pre><code>$languages = implode(',', $_POST['language[]']);
  </code></pre>
  
  <p>What I am trying to do is to save all values from the <code>$_POST["language"]</code> array in one variable, separated with commas (and no comma at the end). </p>
  
  <p>Can someone help me with this ?</p>
  
  <p>Many thanks in advance</p>