title: Is in PHP a function which can check if string is a extension?
body: <p>Is In PHP a function which can check if string is a extension of a file? For example:</p>
  
  <pre><code>$q = 'txt';
  
  if ( is_extension($q) )
  {
      echo "yee, this is a extension";
  }
  else
  {
      echo "no, this isn't any extension";
  }
  </code></pre>
  
  <p>I have a URL, for example: <a href="http://example.com/user-name/user-dir/any-file-to-download.txt(text)" rel="nofollow">http://example.com/user-name/user-dir/any-file-to-download.txt(text)</a>. I would like to check if this URL contain any extension and check if this extension is correct.</p>
  
  <p>Thanks!</p>