PHP code example of higimo / mime-2-ext

1. Go to this page and download the library: Download higimo/mime-2-ext library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

higimo / mime-2-ext example snippets



	$file = file_get_contents('./file.otf');
	\Higimo\Mime2Ext::getMime($file); // 'application/vnd.ms-opentype'
	\Higimo\Mime2Ext::getExt($file); // otf
	\Higimo\Mime2Ext::getExtByFile($file); // otf
	\Higimo\Mime2Ext::getExtByMime('application/vnd.ms-opentype'); // otf
	\Higimo\Mime2Ext::get('application/vnd.ms-opentype'); // otf