title: Multiple Photo Upload PHP
body: <p>I've looked around and have struggled to find out how to upload multiple images (.jpg/.png/etc). 
  For my task I was looking to upload 5 pictures to the database record. So far I'm struggling to even upload 5 together in one record. I've used PHP from the Ws3 website and it works successfully but this code is for one image alone. </p>
  
  <p>PHP Code -</p>
  
  <pre><code> $allowedExts = array("gif", "jpeg", "jpg", "png");
      $temp = explode(".", $_FILES["file"]["name"]);
      $extension = end($temp);
  
  if ((($_FILES["file"]["type"] == "image/gif")
  || ($_FILES["file"]["type"] == "image/jpeg")
  || ($_FILES["file"]["type"] == "image/jpg")
  || ($_FILES["file"]["type"] == "image/png"))
  &amp;&amp; ($_FILES["file"]["size"] &lt; 2000000)
  &amp;&amp; in_array($extension, $allowedExts))
  {
    if ($_FILES["file"]["error"] &gt; 0)
    {
      echo "Return Code: " . $_FILES["file"]["error"] . "&lt;br&gt;";
    }
    else
    {
  
      if (file_exists("upload/" . $_FILES["file"]["name"]))
      {
  
      }
      else
      {
          move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . uniqid() . "_" . $_FILES["file"]["name"]);
      }
    }
  }
  else
  {
      $error =  "Invalid file";
  }
  </code></pre>
  
  <p>My HTML  is as follows,</p>
  
  <pre><code>&lt;label for="file"&gt;Filename:&lt;/label&gt;
          &lt;input type="file" name="file" id="file"&gt;
  
          &lt;input type="file" name="file" id="file"&gt;
  
          &lt;input type="file" name="file" id="file"&gt;
  
          &lt;input type="file" name="file" id="file"&gt;
  
          &lt;input type="file" name="file" id="file"&gt;
  </code></pre>
  
  <p>Any advice is greatly appreciated guys! Cheers</p>