Skip to content

vnappmob/ext-mime-type

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Helper to get MIME type in PHP

The current PHP mime_content_type returns the MIME content type for a file as determined by using information from the magic.mime file. It might be text/plain for file type like css or javascript

This implementation using a map/dictionary of file extension to parse file type content (Original from svogal)

Usage

require_once __DIR__ . '/vendor/autoload.php';

$file_path = './path/to/file.js';
$mime_type = VNAppMob\ExtMimeType::getMimeContentType($file_path);
...

About

PHP Custom MIME Content Type

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages