php-extended / php-mime-type-object
An implementation of the php-extended/php-mime-type-interface library
Package info
gitlab.com/php-extended/php-mime-type-object
pkg:composer/php-extended/php-mime-type-object
Requires
Requires (Dev)
This package is auto-updated.
Last update: 2026-06-07 12:35:07 UTC
README
An implementation of the php-extended/php-mime-type-interface library.
This library uses the https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types source file to update its contents.
This library uses the https://www.iana.org/assignments/media-types/media-types.xhtml source file to update its contents.
This library is updated once a week, every sunday.
Last Updated Date : 2026-02-08
Installation
The installation of this library is made via composer and the autoloading of all classes of this library is made through their autoloader.
- Download
composer.pharfrom their website. - Then run the following command to install this library as dependency :
php composer.phar php-extended/php-mime-type-object ^9
Basic Usage
This library is to provide standard classes to be manipulated with a mime type provider.
To parse mime types, use the following :
use PhpExtended\MimeType\MimeTypeParser;
$parser = new MimeTypeParser();
$type = $parser->parse('text/html');
// $type is now a MimeTypeInterface with value "html", and
// parent category as MimeCategoryInterface with value "text".
License
MIT (See license file).