PHP code example of decodelabs / typify

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

    

decodelabs / typify example snippets


use DecodeLabs\Typify;

echo Typify::detect(__FILE__);
// application/x-php

use DecodeLabs\Typify;

$exts = Typify::getExtensionsFor('text/plain');
// txt, text, conf, def, list, log, in

use DecodeLabs\Typify;

echo Typify::getExtensionFor('text/plain');
// txt