Skip to content

Core\Mime

Finds out what kind of file some bytes are, such as a PNG image or a PDF, by reading the first bytes. detect returns a Core\Mime::Type case, and mediaType gives its name, such as image/png.

Members

2 members.

MemberSignature
detectdetect(Core\Bytes::Source $data): Core\Mime::Type
mediaTypemediaType(Core\Mime::Type $type): string

Enums

  • TypeThe kind of file that Core\Mime::detect found in some bytes. The list of cases is fixed, so your program compares the result with a case. Every text format gives Unknown.