title: Submit multiple values from array in php
body: <p><strong>here are the html :</strong> </p>
  
  <pre><code>&lt;div class="control-group"&gt;
      &lt;label class="control-label"&gt;Pilih Item :&lt;/label&gt;
      &lt;div class="controls"&gt;
          &lt;?php 
          $id=$_GET['id'];
          foreach($db-&gt;tampil_data_invoice($id) as $d){
              $lihatitem = mysql_query("select * from tbl_item where id_item ='$d[id_item]'");
              $item = mysql_fetch_array($lihatitem);
              $lihatkemasan = mysql_query("select * from tbl_harga_item where id_harga ='$d[id_harga]'");
              $kemasan = mysql_fetch_array($lihatkemasan);
              echo '&lt;input type="checkbox" name="id_alokasi[]" value="$d[id_alokasi]"/&gt;&lt;table class="table table-bordered data-table"&gt;
          &lt;tr&gt;&lt;th&gt;Nama Item&lt;/th&gt;
          &lt;th&gt;Kemasan&lt;/th&gt;
          &lt;th&gt;Qty&lt;/th&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;'.$item[nama_item].' &lt;/td&gt;&lt;td&gt;kemasan : '.$kemasan[kemasan].'&lt;/td&gt;&lt;td&gt;qty : '.$d[alokasi].'&lt;/td&gt;&lt;/table&gt;&lt;/br&gt;&lt;/tr&gt;';
          }?&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  
  
  &lt;?php 
  $number = count($_POST["id_alokasi"]);  
  if($number &gt; 0)  
  {  
      for($i=0; $i&lt;$number; $i++)  
      {  
          if(trim($_POST["id_alokasi"][$i] != ''))  
          {  
              $sql = "INSERT INTO tbl_item_invoice VALUES('', '$id_invoice','$_POST[id_alokasi][$i])','')";  
              mysql_query($sql);  
          }  
      }  
  ?&gt;
  </code></pre>
  
  <p>Can anybody help me here why <strong>$_POST['id_alokasi']</strong> return Array, not the value. is there any something wrong with the my code? thanks in advance</p>