PHP code example of brightnucleus / mime-types
1. Go to this page and download the library: Download brightnucleus/mime-types 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/ */
brightnucleus / mime-types example snippets
use BrightNucleus\MimeTypes\MimeTypes;
// Get the extensions for a given MIME type.
$extensions = MimeTypes::getExtensionsForType( 'image/jpeg' ); // Returns array( 'jpeg', 'jpg', 'jpe' ).
// Get the MIME types for a given extension.
$mimeTypes = MimeTypes::getTypesForExtension( 'jpg' ); // Returns array( 'image/jpeg' ).