PHPackages                             neoncitylights/media-type - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. neoncitylights/media-type

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

neoncitylights/media-type
=========================

Allows working with IANA media types as entities in PHP

v3.1.0(1y ago)114.7k↓30%[4 PRs](https://github.com/php-lights/media-type/pulls)2MITPHPPHP &gt;=8.2CI passing

Since Oct 28Pushed 4mo agoCompare

[ Source](https://github.com/php-lights/media-type)[ Packagist](https://packagist.org/packages/neoncitylights/media-type)[ GitHub Sponsors](https://github.com/sponsors/neoncitylights)[ RSS](/packages/neoncitylights-media-type/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (6)Versions (10)Used By (2)

MediaType
=========

[](#mediatype)

[![Packagist version](https://camo.githubusercontent.com/a939db87f9c932682cfc7b4590f434e362c1c7cf340f1b11dd90ee3e1284c552/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e656f6e636974796c69676874732f6d656469612d747970653f7374796c653d666c61742d737175617265)](https://packagist.org/packages/neoncitylights/media-type)[![License](https://camo.githubusercontent.com/7d217ebb91a61cb4d98e70dee31eb08e0a5f71bc518ebd4151a73c6fb1191d00/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75653f7374796c653d666c61742d737175617265)](#license)[![Docs](https://camo.githubusercontent.com/dd1f50f71eb73c0cbb15ca1efed7fca468769483295cc64459878022fd65f8a6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6465706c6f796d656e74732f7068702d6c69676874732f6d656469612d747970652f6769746875622d70616765733f6c6162656c3d646f6373267374796c653d666c61742d737175617265)](https://php-lights.github.io/media-type/)[![CI](https://camo.githubusercontent.com/ecfc9a318c2d1f84a1da463a8db343e8b19b231d6d61d457425a2735dc6509d3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7068702d6c69676874732f6d656469612d747970652f2e676974687562253246776f726b666c6f77732532467068702e796d6c3f7374796c653d666c61742d737175617265)](https://github.com/php-lights/media-type/actions/workflows/php.yml)[![Code coverage](https://camo.githubusercontent.com/7340cc2f2f9783493b918908ecb99617921e4ef7dda74cf1d425343abd3e7adc/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f7068702d6c69676874732f6d656469612d747970653f7374796c653d666c61742d737175617265)](https://codecov.io/gh/php-lights/media-type)

**MediaType** is a PHP library for parsing and serializing MIME types, also known as IANA media types.

This library is compliant to the [WHATWG Mime Sniffing Standard](https://mimesniff.spec.whatwg.org/).

Install
-------

[](#install)

System requirements:

- Minimum PHP version: 8.2
- [`intl`](https://www.php.net/intl) PHP extension ([installation instructions](https://www.php.net/manual/en/intl.installation.php))

```
composer require neoncitylights/media-type
```

Usage
-----

[](#usage)

### Parsing

[](#parsing)

```
