php get file mime type code example
Example 1: php get file mime type
echo mime_content_type("yourfile.gif"); //image/gif
Example 2: php get size of file
$fileSizeInBytes=filesize("/path/to/myfile.txt");
Example 3: php get filetype
<?php
echo filetype('/etc/passwd'); // file
echo filetype('/etc/'); // dir
?>