PHP code example of yzalis / identicon

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

    

yzalis / identicon example snippets

 php
$identicon = new \Identicon\Identicon();
 php
$identicon->displayImage('foo');
 php
$imageData = $identicon->getImageData('bar');
 php
$imageDataUri = $identicon->getImageDataUri('bar');
 html
<img src=" echo $imageDataUri; 
 php
$identicon->displayImage('foo', 512);
 php
$identicon->displayImage('bar', 64, 'A87EDF');
 php
$identicon->displayImage('foo', 64, array(200, 100, 150));
 php
$identicon = new \Identicon\Identicon(new SvgGenerator());
$imageDataUri = $identicon->getImageDataUri('bar');
<img src="<?= $imageDataUri; 

php composer.phar install