title: How to check uploaded file type in PHP
body: <p>I used this code to check for the type of images,</p>
  
  <pre><code>$f_type=$_FILES['fupload']['type'];
  
  if ($f_type== "image/gif" OR $f_type== "image/png" OR $f_type== "image/jpeg" OR $f_type== "image/JPEG" OR $f_type== "image/PNG" OR $f_type== "image/GIF")
  {
      $error=False;
  }
  else
  {
      $error=True;
  }
  </code></pre>
  
  <p>but some users complain they get an error while uploading any type of images, while some others don't get any errors!</p>
  
  <p>I was wondering if this fixes the problem:</p>
  
  <p><code>if (mime_content_type($_FILES['fupload']['type']) == "image/gif"){...</code></p>
  
  <p>Any comments?</p>