Supported Versions: PHP >= 5.3.0, PHP 7, PHP 8, PECL fileinfo >= 0.1.0
Return information about a file
<?php finfo_file(    finfo $finfo,    string $filename,    int $flags = FILEINFO_NONE,    ?resource $context = null): string|false
<?php     public function mimeType($path)

    {

        return finfo_file(finfo_open(FILEINFO_MIME_TYPE), $path);

    }