PHP code example of wgenial / php-mimetypeicon

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

    

wgenial / php-mimetypeicon example snippets



WGenial\PHPMimeTypeIcon\PHPMimeTypeIcon;

echo "<img src='". PHPMimeTypeIcon::getURI('file1.zip',16) ."'>";
echo "<img src='". PHPMimeTypeIcon::getURI('file2.txt',22) ."'>";
echo "<img src='". PHPMimeTypeIcon::getURI('file2.docx',24) ."'>";
echo "<img src='". PHPMimeTypeIcon::getURI('file3.xml',32) ."'>";
echo "<img src='". PHPMimeTypeIcon::getURI('file4.html',48) ."'>";
echo "<img src='". PHPMimeTypeIcon::getURI('file5.js',64) ."'>";
echo "<img src='". PHPMimeTypeIcon::getURI('https://upload.wikimedia.org/wikipedia/commons/2/26/Logo-composer-transparent.png',96) ."'>";
echo "<img src='". PHPMimeTypeIcon::getURI('https://en.wikipedia.org/wiki/PHP#/media/File:PHP-logo.svg','scalable') ."'>";
echo "<img style='width:120px;height:120px;' src='". PHPMimeTypeIcon::getURI('file6.xlsx','scalable') ."'>";
echo "<img style='width:180px;height:180px;' src='". PHPMimeTypeIcon::getURI('https://media.giphy.com/media/13hxeOYjoTWtK8/giphy.gif','scalable') ."'>";

composer