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\Detector;

$detector = new Detector();
echo $detector->detect(__FILE__);
// application/x-php

$exts = $detector->getExtensionsFor('text/plain');
// txt, text, conf, def, list, log, in

echo $detector->getExtensionFor('text/plain');
// txt