I am trying to pull the filename out of a directory without the extension.
I am kludging my way through with the following:
foreach ($allowed_files a
Try this:
$noExt = preg_replace("/\\.[^.]*$/", "", $filename);
Edit in response to cletus's comment:
You could change it in one of a few ways:
$noExt = preg_replace("/\\.[^.]*$/", "", basename($filename));
// or
$noExt = preg_replace("/\\.[^.\\\\\\/]*$/", "", $filename);
Yes, PHP needs regex literals...