public static function getExtension($filename, $withDot = true)
    {
        $filename = basename($filename);
        if (false === strrpos($filename, '.')) {
            return '';
        }

        return substr($filename, strrpos($filename, '.') - strlen($filename) + ($withDot ? 0 : 1));
    }
public static function getExtension($filename, $withDot = true)
    {
        $filename = basename($filename);
        if (false === strrpos($filename, '.')) {
            return '';
        }

        return substr($filename, strrpos($filename, '.') - strlen($filename) + ($withDot ? 0 : 1));
    }
public static function getExtension ( $ filename , $ withDot = true ) { $ filename = basename ( $ filename ) ; if ( false === strrpos ( $ filename , '.' ) ) { return '' ; } return substr ( $ filename , strrpos ( $ filename , '.' ) - strlen ( $ filename ) + ( $ withDot ? 0 : 1 ) ) ; }
Returns the extension file base on its name
@param  string  $filename
@param  Boolean $withDot
@return string
Returns the extension file base on its name