Mimetype helper functions
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
func
.gitignore
COPYING
COPYING.LESSER
README.md
composer.json

README.md

func-mimetype

Mimetype helper functions

Usage

$file = 'test.html';
$mimetype = system_extension_mime_type($file); //returns text/html
$ext = system_mime_type_extension('text/html'); //returns .html

Reference

(string) system_extension_mime_type($file)

Returns the mime type purely by file extension

(string) system_mime_type_extension($mimetype)

Returns the file extension assoicated with the mime type