apokalipscke / FileMimer

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FileMimer

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.

About

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


Languages

Language:PHP 99.5%Language:Shell 0.5%