apokalipscke / file-mimer
Get the human file type name from mime types and files.
0.4.5
2022-03-31 22:22 UTC
Requires
- php: >=7.3
- symfony/http-foundation: ^5.0
- symfony/mime: ^5.4|^6.0
Requires (Dev)
- phpunit/phpunit: >=9
This package is auto-updated.
Last update: 2024-10-29 05:53:18 UTC
README
Get the human file type name from mime types and files.
installation
composer require apokalipscke/file-mimer
usage
get from mime type
use Apokalipscke\FileMimer\FileMimer; $fileTypeName = FileMimer::get('audio/mpeg');
returns:
"MPEG Audio"
get from file
use Apokalipscke\FileMimer\FileMimer; $fileTypeName = FileMimer::getFromFile("/path/to/your.file");
Need more examples? Have a look at the tests.