/ Published in: PHP
Released into the public domain. Amend $file_types as you wish to add more types.
Expand |
Embed | Plain Text
global $file_types; $file_types = array('image/jpeg' => 'JPEG Image', 'image/png' => 'PNG Image', 'image/gif' => 'GIF Image', 'text/plain' => 'Text Document', 'text/html' => 'HTML Document', 'text/javascript' => 'JavaScript File', 'text/css' => 'CSS Stylesheet'); function humanize_file_type($mime_type) { return $GLOBALS['file_types'][$mime_type]; else { return $slash_position === false ? $mime_type : strtoupper(substr($mime_type, $slash_position + 1)) . " File"; } }
You need to login to post a comment.
