pathinfo() has already been mentioned here, but I would like to add that from PHP 5.2 it also has an easy way to access the file name WITHOUT the extension.
$filename = pathinfo('path/to/file.php', PATHINFO_FILENAME);
The value of $filename will be file .
source share