title: Mime type and PATHINFO_EXTENSION
body: <p>I am using <a href="http://php.net/manual/en/function.pathinfo.php" rel="nofollow">pathinfo</a> to find the extension of a file type.</p>
  
  <pre><code>pathinfo( $file, PATHINFO_EXTENSION );
  </code></pre>
  
  <p>Looking at the PHP manual, it doesn't clarify <em>how</em> this function gets this information. Does this check the image for its MIME type and return that or does it just find the extension by using <code>explode()</code> or such?</p>
  
  <p>If the MIME is not returned, what is the most 'modern' way of checking a files MIME type? </p>
  
  <p>And is it a wise to compare the MIME with the extension?</p>