PHP code example of astrotomic / php-unavatar

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

    

astrotomic / php-unavatar example snippets


use Astrotomic\Unavatar\Unavatar;

$unavatar = new Unavatar('[email protected]');
Unavatar::email('[email protected]');
Unavatar::username('Astrotomic');
Unavatar::domain('astrotomic.info');
Unavatar::github('Astrotomic');

$unavatar->fallback('https://example.com/image.jpg');

$unavatar->toUrl();

$unavatar->toImg(['loading' => 'lazy']);
bash
composer