mime_content_type
Description
The mime_content_type of Fileinfo for PHP detects the MIME Content-type for a file.
Syntax
mime_content_type( resource|string $filename ): string|false
Parameters
filename
Path to the tested file.
Return
Returns the content type in MIME format, like text/plain or application/octet-stream, or false on failure.
Examples
1 · filename
<? $filename = $_SERVER["DOCUMENT_ROOT"] . "/assets/txt/1.txt"; $return = mime_content_type($filename); echo $return;
text/plain