felipe-marques-aloware / mime-types
A converter between mime types and file extensions.
Package info
github.com/felipe-marques-aloware/mime-types
pkg:composer/felipe-marques-aloware/mime-types
v1.0.0
2024-04-09 22:58 UTC
Requires (Dev)
README
Converts mime types to the proper file extensions and vice versa.
Installation
composer require felipe-marques-aloware/mime-types
Usage
Create a new mime type converter instance:
use Magyarjeti\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