application/Espo/Core/Utils/File/Manager.php
public function getFileName($fileName, $ext='')
    {
        if (empty($ext)) {
            $fileName= substr($fileName, 0, strrpos($fileName, '.', -1));
        }
        else {
            if (substr($ext, 0, 1)!='.') {
                $ext= '.'.$ext;
            }

            if (substr($fileName, -(strlen($ext)))==$ext) {
                $fileName= substr($fileName, 0, -(strlen($ext)));
            }
        }

        $exFileName = explode('/', Utils\Util::toFormat($fileName, '/'));

        return end($exFileName);
    }
public function getFileName($fileName, $ext='')
    {
        if (empty($ext)) {
            $fileName= substr($fileName, 0, strrpos($fileName, '.', -1));
        }
        else {
            if (substr($ext, 0, 1)!='.') {
                $ext= '.'.$ext;
            }

            if (substr($fileName, -(strlen($ext)))==$ext) {
                $fileName= substr($fileName, 0, -(strlen($ext)));
            }
        }

        $exFileName = explode('/', Utils\Util::toFormat($fileName, '/'));

        return end($exFileName);
    }
public function getFileName ( $ fileName , $ ext = '' ) { if ( empty ( $ ext ) ) { $ fileName = substr ( $ fileName , 0 , strrpos ( $ fileName , '.' , - 1 ) ) ; } else { if ( substr ( $ ext , 0 , 1 ) != '.' ) { $ ext = '.' . $ ext ; } if ( substr ( $ fileName , - ( strlen ( $ ext ) ) ) == $ ext ) { $ fileName = substr ( $ fileName , 0 , - ( strlen ( $ ext ) ) ) ; } } $ exFileName = explode ( '/' , Utils \ Util :: toFormat ( $ fileName , '/' ) ) ; return end ( $ exFileName ) ; }
Get a filename without the file extension

@param string $filename
@param string $ext - extension, ex. '.json'

@return array
Get a filename without the file extension