title: PHP: How to fix array_combine when one valus is empty
body: <p>How to set a <code>= 0</code> value for each <code>checkbox</code> unchecked </p>
  
  <p><strong>Error:</strong></p>
  
  <pre>
  Warning: array_combine() [function.array-combine]: Both parameters should have an equal number of elements in
  </pre>
  
  <p><strong>PHP:</strong></p>
  
  <pre>
  <code>
  $combined = array_combine($_POST['name'], $_POST['day']);
  
  foreach($combined as $name => $value) {
       echo $name.' => '.$value;
  }
  </code>
  </pre>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code>  &lt;form method="post" action="result.php"&gt;
    &lt;p&gt;
          &lt;input type="text" name="name[]" value="seth" /&gt;
          &lt;input type="checkbox" name="day[]" value="7" /&gt;
    &lt;/p&gt;
  
    &lt;p&gt;
          &lt;input type="text" name="name[]" value="jack" /&gt;
          &lt;input type="checkbox" name="day[]" value="4" /&gt;
    &lt;/p&gt;
  
    &lt;p&gt;
          &lt;input type="text" name="name[]" value="david" /&gt;
          &lt;input type="checkbox" name="day[]" value="3" /&gt;
    &lt;/p&gt;
  
   &lt;/form&gt;
  </code></pre>
  
  <p><strong>PS:</strong> <br />
  I won't use:</p>
  
  <pre><code>        &lt;select name="day[]" size="1"&gt;
             &lt;option value="0"&gt; Non &lt;/option&gt;
             &lt;option value="1"&gt; Yes &lt;/option&gt;
          &lt;/select&gt;
  </code></pre>