PHP Classes

File: src/examples/general_example.php

Recommend this page to a friend!
  Classes of Martin Latter   PHP Detect File Type   src/examples/general_example.php   Download  
File: src/examples/general_example.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Detect File Type
Identify files via MIME type and file signatures
Author: By
Last change:
Date: 4 years ago
Size: 514 bytes
 

Contents

Class file image Download
<?php

/**
    * General example usage of FileIdentifier class.
    * Martin Latter, 15/06/2016
*/

declare(strict_types=1);

###################################################
require('../FileIdentifier.php');
require(
'../FileSignatures.php');
###################################################

use Tinram\FileIdentifier\FileIdentifier;

$oFileCheck = new FileIdentifier('file_examples/mira.png');
$aResult = $oFileCheck->getResult();

echo
$aResult['mimeinfo'] . PHP_EOL;
echo
$aResult['fileinfo'] . PHP_EOL;