title: how to count number of uploaded files in php
body: <p>How can i count the number of uploaded files?
  This is my form:</p>
  
  <pre><code>&lt;div id="dragAndDropFiles" class="uploadArea"&gt;
          &lt;h1&gt;Drop Images Here&lt;/h1&gt;
      &lt;/div&gt;
      &lt;form id="sfmFiler" class="sfmform" method="post" enctype="multipart/form-data"&gt;
          &lt;input type="file" name="file" id="file" multiple /&gt;
          &lt;input type="submit" name="submitHandler" id="submitHandler" class="buttonUpload" value="Upload"&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>and this is the piece of php which uploads the files:</p>
  
  <pre><code>if($_SERVER['REQUEST_METHOD'] == "POST") {
      $tmpFilePath = $_FILES['file']['tmp_name'];
      $newFilePath = $dir.'/' . $_FILES['file']['name'];
      if(move_uploaded_file($tmpFilePath, $newFilePath)) {
        echo "xxx files are successfully uploaded";
      }
  } 
  </code></pre>