Gets the primary known file extension for this MIME type.
Source
public function toExtension(): string
{
// Reverse lookup for the MIME type to find the extension.
$extension = array_search($this->value, self::$extensionMap, \true);
if ($extension === \false) {
throw new InvalidArgumentException(sprintf('No known extension for MIME type: %s', $this->value));
}
return $extension;
}
Changelog
| Version | Description |
|---|---|
| 0.1.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.