get file mimetype php code example
Example 1: php get file mime type
echo mime_content_type("yourfile.gif"); //image/gif
Example 2: php get filetype
<?php
echo filetype('/etc/passwd'); // file
echo filetype('/etc/'); // dir
?>
echo mime_content_type("yourfile.gif"); //image/gif
<?php
echo filetype('/etc/passwd'); // file
echo filetype('/etc/'); // dir
?>