https://khactung.com/develop/php-get-type-file-function/
PHP get type file function