PHP code example of skyzyx / mimetypes

1. Go to this page and download the library: Download skyzyx/mimetypes 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/ */

    

skyzyx / mimetypes example snippets


$mimetypes = json_decode('/path/to/mimetypes/mimetypes.json', true);
$type = $mimetypes['html'];
#=> text/html

// ...or...

use Skyzyx\Components\Mimetypes\Mimetypes;
$type = Mimetypes::getInstance()->fromExtension('html');
#=> text/html