public static function getType($path)
    {
        if (!is_file($path)) {
            throw new \InvalidArgumentException(sprintf('invalid filename or path "%s"', $path));
        }

        $info = (new \finfo(FILEINFO_MIME))->file($path);

        return substr($info, 0, strpos($info, ';'));
    }
public static function getType($path)
    {
        if (!is_file($path)) {
            throw new \InvalidArgumentException(sprintf('invalid filename or path "%s"', $path));
        }

        $info = (new \finfo(FILEINFO_MIME))->file($path);

        return substr($info, 0, strpos($info, ';'));
    }
public static function getType ( $ path ) { if ( ! is_file ( $ path ) ) { throw new \ InvalidArgumentException ( sprintf ( 'invalid filename or path "%s"' , $ path ) ) ; } $ info = ( new \ finfo ( FILEINFO_MIME ) ) -> file ( $ path ) ; return substr ( $ info , 0 , strpos ( $ info , ';' ) ) ; }
get file mime type

@param stirng $path image file path

@return string
get file mime type