title: PHP explode multiple uploaded file into variable
body: <p>I got a form with multiple upload input, while in the process, I need to separate each in order to update database</p>
  
  <pre><code>if(isset($_FILES['files'])){
  
  foreach($_FILES['files']['tmp_name'] as $key =&gt; $tmp_name){
  
      $file_name = $_FILES['files']['name'][$key];
      $file_size = $_FILES['files']['size'][$key];
      $file_tmp = $_FILES['files']['tmp_name'][$key];
      $file_type = $_FILES['files']['type'][$key];
  
      echo '&lt;pre&gt;'.print_r($_FILES['files'], TRUE).'&lt;/pre&gt;';
      }
  }
  </code></pre>
  
  <p>let say I have 2 uploaded file, here is data in hierarchical view for these files:</p>
  
  <pre><code>Array
  (
  [name] =&gt; Array
      (
          [0] =&gt; model8.jpg
          [1] =&gt; leslie.jpg
      )
  
  [type] =&gt; Array
      (
          [0] =&gt; image/jpeg
          [1] =&gt; image/jpeg
      )
  
  [tmp_name] =&gt; Array
      (
          [0] =&gt; C:\xampp\tmp\php906A.tmp
          [1] =&gt; C:\xampp\tmp\php906B.tmp
      )
  
  [error] =&gt; Array
      (
          [0] =&gt; 0
          [1] =&gt; 0
      )
  
  [size] =&gt; Array
      (
          [0] =&gt; 13285
          [1] =&gt; 45086
      )
  
  )
  
  Array
  (
  [name] =&gt; Array
      (
          [0] =&gt; model8.jpg
          [1] =&gt; leslie.jpg
      )
  
  [type] =&gt; Array
      (
          [0] =&gt; image/jpeg
          [1] =&gt; image/jpeg
      )
  
  [tmp_name] =&gt; Array
      (
          [0] =&gt; C:\xampp\tmp\php906A.tmp
          [1] =&gt; C:\xampp\tmp\php906B.tmp
      )
  
  [error] =&gt; Array
      (
          [0] =&gt; 0
          [1] =&gt; 0
      )
  
  [size] =&gt; Array
      (
          [0] =&gt; 13285
          [1] =&gt; 45086
      )
  
  )
  </code></pre>
  
  <p>How can I set each of the data into a variable for further process? </p>
  
  <p>Thanks!</p>