- ⌂ mime_type
- Static Methods
mime_type::get_mime_type_from_ext()
Get a MIME Type from a file extension, such as "pdf".
Prototype
string get_mime_type_from_ext(string $ext)
Parameters
- ext - A string containing the file extension, like "pdf".
Return
A MIME Type like 'application/pdf'.
Example
// print the MIME Type for the PDF file extension
$ext = 'pdf';
$mime_type = \io_comand_util\mime_type::get_mime_type_from_ext($ext);
echo("MIME Type for extension $ext is $mime_type");