php code:
<?php
foreach (glob("/path/to/maps/*.bsp") as $file) {
$info = pathinfo($file);
echo $info['filename']; // requires PHP 5.2.0 !!!
}
?>
If you're running on PHP < 5.2.0, you can get the file name using substr() and strrpos():
php code:
$info = pathinfo($file);
$basename = $info['basename'];
echo substr($basename, 0, strrpos($basename, '.'));