better way to see if file has certain extention
<p>I'm doing this right now in my code to see if a file name has the extension <code>.txt</code>, but I think it basically checks if it <strong>contains</strong> <code>.txt</code> and not necessarily <strong>ends with</strong> <code>.txt</code>. Does php have a better way to do extension checking instead of using <code>strpos</code>?</p>

<pre><code>strpos($filename,'.txt') !== false
</code></pre>
