library mime-types
Mime type library
pekkis/mime-types
Mime type library
- Monday, July 27, 2015
- by pekkis
- Repository
- 1 Watchers
- 2 Stars
- 30,110 Installations
- PHP
- 5 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 2 Versions
- 5 % Grown
pekkis/mime-types
A library for handling mime types, (*1)
Use cases
- Resolve a file's mime type (via different strategies if necessary)
- Resolve a file extension's mime type
- Resolve a mime type's file extension(s) and override if needed.
Quickstart
<?php
use Pekkis\MimeTypes\MimeTypes;
$mt = new MimeTypes();
// Resolve mime type
$mimeType = $mt->resolveMimeType($pathToFile);
// Extension to mime type
$mimeType = $mt->extensionToMimeType($extension);
// Mime type to extension
$extension = $mt->mimeTypeToExtension('image/jpeg');
// Don't like .jpeg extension? override it.
$mt->override('jpeg', 'jpg');
dev-master
9999999-dev
Mime type library
Sources
Download
BSD-3-Clause
The Requires
The Development Requires
mime
mime type
v1.0.0
1.0.0.0
Mime type library
Sources
Download
BSD-3-Clause
The Requires
The Development Requires
mime
mime type