Obtener extensión
<?php // will get the file name out of whole path (path/to/file.inc.php) $filename = basename($filePath); // split it into part by dot $filePartArr = explode('.', $f); // get the last one $ext = $arr[count($filePartArr) - 1]; ?>
Nombre del archivo sin extensión
<?php $fileBaseName = basename ($file, '.php'); ?>
Vía: Web Scripting

Apuntes