Checks if this MIME type is a specific type.
Description
This method returns true when the stored MIME type begins with the given prefix. For example, "audio" matches "audio/mpeg".
Parameters
$mimeTypestringrequired- The MIME type prefix to check (e.g., "audio", "image").
Source
public function isType(string $mimeType): bool
{
return str_starts_with($this->value, strtolower($mimeType) . '/');
}
Changelog
| Version | Description |
|---|---|
| 0.1.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.