PHP: filename without file extension- best way?
<p>I am trying to pull the filename out of a directory without the extension.</p>

<p>I am kludging my way through with the following:</p>

<pre><code>foreach ($allowed_files as $filename) { 
  $link_filename = substr(basename($filename), 4, strrpos(basename($filename), '.'));
  $src_filename = substr($link_filename, 0, strrpos($link_filename) - 4);
  echo $src_filename;
}
</code></pre>

<p>...But that can't work if the extension string length is more than 3.
I looked around in the PHP docs to no avail.</p>
