title: Load multiple files using HTML5 and PHP
body: <p>I am trying to load multiple files using HTML5.
  This is my code I found on some site.
  In the PHP code it doesn't recognize it as an array.</p>
  
  <p>Am I doing something wrong? Can someone show me a working solution?</p>
  
  <p>Thanks.</p>
  
  <p>index.html</p>
  
  <pre><code>&lt;form action='save.php' method='post' enctype='multipart/form-data'&gt;
  &lt;input name="uploads" type="file" multiple="multiple" /&gt;
  &lt;input type='submit' value="Upload File"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>save.php</p>
  
  <pre><code>function GetFiles() {
          $files = array();
          $fdata = $_FILES["uploads"];
          if (is_array($fdata["name"])) {//This is the problem
                  for ($i = 0; $i &lt; count($fdata['name']); ++$i) {
                          $files[] = array(
                              'name' =&gt; $fdata['name'][$i],
                              'tmp_name' =&gt; $fdata['tmp_name'][$i],
                          );
                  }
          } else {
                  $files[] = $fdata;
          }
  
          foreach ($files as $file) {
                  // uploaded location of file is $file['tmp_name']
                  // original filename of file is $file['file']
          }
  }
  </code></pre>