title: Submitting a multidimensional array with file input via POST with php
body: <p>I have a php form that has a known number of columns (ex. top product, price, quantity, file(file input)), but has an unknown number of rows, as users can add rows as they need.</p>
  
  <p>I am using a multidimensional array: </p>
  
  <pre><code>name="prod[0][name]"
  name="prod[0][qty]"
  name="prod[0][file]"
  </code></pre>
  
  <p>on post I use</p>
  
  <pre><code> if ( isset( $_POST['prod'] ) )
      {
  
          foreach ( $_POST['prod'] as $value )
          {
              //some code here
  if (isset($_FILES[$value["file"]]["name"]) &amp;&amp; 
      ($_FILES[$value["file"]]["size"] &gt; 0) &amp;&amp;
      ($_FILES[$value["file"]]["error"]==0) &amp;&amp;
      $_FILES[$value["file"]]["name"] != "" )
    {
     //code of uploading file
  
   } 
  
      }
  </code></pre>
  
  <p>My problem is I can't get the file to  be uploaded, I always get the error </p>
  
  <blockquote>
    <p>$value["file"] is undefined</p>
  </blockquote>
  
  <p><strong>please help</strong></p>