apokalipscke/file-mimer

Get the human file type name from mime types and files.

0.4.5 2022-03-31 22:22 UTC

This package is auto-updated.

Last update: 2024-10-29 05:53:18 UTC


README

CircleCI Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

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.