PHP code example of dmamontov / favicon

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

    

dmamontov / favicon example snippets




$fav = new FaviconGenerator(__DIR__ . '/tests.png');

$fav->setCompression(FaviconGenerator::COMPRESSION_VERYHIGH);

$fav->setConfig(array(
    'apple-background'    => FaviconGenerator::COLOR_BLUE,
    'apple-margin'        => 15,
    'android-background'  => FaviconGenerator::COLOR_GREEN,
    'android-margin'      => 15,
    'android-name'        => 'My app',
    'android-url'         => 'http://slobel.ru',
    'android-orientation' => FaviconGenerator::ANDROID_PORTRAIT,
    'ms-background'       => FaviconGenerator::COLOR_GREEN,
));

echo $fav->createAllAndGetHtml();