PHP.nl

mime_content_type

mime_content_type

Detect MIME Content-type for a file

 **mime_content_type**  $filename

Returns the MIME content type for a file as determined by using information from the file.

filenamePath to the tested file.

Returns the content type in MIME format, like or , return.falseforfailure. text/plain``application/octet-stream

Voorbeeld: Example

<?php
echo mime_content_type('php.gif') . "\n";
echo mime_content_type('test.php');
?>
image/gif
text/plain

finfo_file``finfo_buffer