title: Multiple file upload using input type file and PHP loop (without jQuery or Javascript)
body: <p>I want to select more image files at a one time and upload as 1,2,3,4,... Like:</p>
  
  <pre><code>&lt;form action="upload_file.php" method="post" enctype="multipart/form-data"&gt;
      &lt;input type="file" name="imgs[]" id="imgs" multiple/&gt; 
      &lt;input type="submit" name="submit" value="Submit" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>PHP code:</p>
  
  <pre><code>&lt;?php
  
  if (file_exists("upload/" . $_FILES["imgs"]["name"]))
        {
        echo $_FILES["file"]["name"] . " already exists. ";
  
        }
      else
        {
  
  //I think loop goes here 
  ===================
        move_uploaded_file($_FILES["file"]["tmp_name"],
        "upload/" . $_FILES["file"]["name"]);
        echo "Stored in: " . "upload/" . $_FILES["file"]["name"];
  ===================
  
        }
  ?&gt;
  </code></pre>
  
  <p>==================================================================</p>
  
  <p>This is works...</p>
  
  <pre><code>&lt;form action="upload_file.php" method="post" enctype="multipart/form-data"&gt;
      &lt;input type="file" name="uploads[]" multiple&gt;
      &lt;input type="submit" name="submit" value="Submit" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>PHP</p>
  
  <pre><code>&lt;?php
  $count=1;
  foreach ($_FILES['uploads']['tmp_name'] as $file) {
    echo '&lt;li&gt;' . $file . '&lt;/li&gt;';
  
    copy($file, "uploads/" . $count.".jpg");
        echo "Stored in: " . "uploads/" . $count.".jpg";
      $count++;
  }
  ?&gt;
  </code></pre>
  
  <p>this is works....</p>