Skip to content

Converts mime types to the proper file extensions and vice versa.

License

Notifications You must be signed in to change notification settings

apxcde/mime-types

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mime Types

Converts mime types to the proper file extensions and vice versa.

Installation

composer require apxcde/mime-types

Usage

Create a new mime type converter instance:

use Apxcde\MimeTypes\MimeTypeConverter;

$converter = new MimeTypeConverter;

Get the proper mime type for a file extension:

echo $converter->toMimeType('jpeg');

or find a file extension to the given mime type:

echo $converter->toExtension('image/jpeg');

Multiple extensions could belong to the same mime type so the code above will return with the first matching one.

Development

Create the Docker based development environment:

make dev

Check the coding style and run unit tests:

make test

About

Converts mime types to the proper file extensions and vice versa.

Resources

License

Stars

Watchers

Forks

Packages

No packages published