// include the Joomla File library jimport('joomla.filesystem.file'); // remove the extension from a file called 'example.php' $fileName = 'example.php'; $fileNameWithoutExt = JFile::stripExt($fileName); echo $fileNameWithoutExt; // outputs "example"
// include the Joomla File library jimport('joomla.filesystem.file'); // remove the extension from a file path $filePath = "/path/to/example.php"; $fileNameWithoutExt = JFile::stripExt($filePath); echo $fileNameWithoutExt; // outputs "/path/to/example"The JFile::stripExt function is part of the Joomla File library, which is included by default in Joomla installations.