title: php multiple file uploads get the exact count of files a user uploaded and not the count of all input fields in the array
body: <p>Ok. I give up on this. When uploading multiple files to the server using php, what is a fail safe method to return the count of files the user has actually uploaded?</p>
  
  <p>Whatever I have done so far, returns the count of all the fields in the form, and the count of the files a user uploads. So if the total fields in the form were 3 and a user uploaded only 2 files, I still get 3 as the count of file uploaded.</p>
  
  <p>One place suggested using <code>array_filter</code> to do this, but that's totally beyond me.</p>
  
  <pre><code>echo count($_FILES['file']['tmp_name']); //3
  
  echo count($_FILES['file']); //3
  </code></pre>
  
  <p>Any fail safe method you follow and can suggest other than looping through the <code>FILES</code> array <code>size</code> to check for this?</p>
  
  <p>My form is structured like any other:</p>
  
  <pre><code>&lt;form action="process.php" method="post" enctype="multipart/form-data"&gt;
  &lt;div&gt;&lt;input type="file" name="file[]"&gt;&lt;/div&gt;
  &lt;div&gt;&lt;input type="file" name="file[]"&gt;&lt;/div&gt;
  &lt;div&gt;&lt;input type="file" name="file[]"&gt;&lt;/div&gt;
  &lt;div&gt;&lt;input type="submit"&gt;&lt;/div&gt;
  &lt;/form&gt;
  </code></pre>