Back to File class

Method stripExt

public static string
stripExt
(mixed $file)
Strips the last extension off of a file name
Parameters
  • string $file The file name
Returns
  • string The file name without the extension
Since
  • 1.7.0
Class: File
Project: Joomla

Method stripExt - Source code

/**
 * Strips the last extension off of a file name
 *
 * @param   string  $file  The file name
 *
 * @return  string  The file name without the extension
 *
 * @since   1.7.0
 */
public static function stripExt($file)
{
    return preg_replace('#\\.[^.]*$#', '', $file);
}