normalizeMimeType.php
Table of Contents
Functions
- normalizeMimeType() : string
- Brings a MIME type name back to the reference name of its format.
Functions
normalizeMimeType()
Brings a MIME type name back to the reference name of its format.
normalizeMimeType(string $mimeType) : string
The name is lower-cased, its parameters are dropped (audio/wav; codecs=1 gives audio/wav),
and an alias listed in MimeTypeAlias::ALIASES becomes the name the catalogue uses
(audio/x-wav gives audio/wav). A name the table does not list comes back lower-cased and
without parameters, unchanged otherwise.
Two names of the same format then compare equal, whichever one finfo reports on a given host
and whichever one a caller wrote : FileMimeType::getExtension() and
validateMimeType() compare normalized names.
Parameters
- $mimeType : string
-
The MIME type name, as reported by
finfoor declared by a client.
Tags
Return values
string —The reference name of the format, or the cleaned name when it has no alias.