1. Go to this page and download the library: Download dicebear/core 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/ */
dicebear / core example snippets
use DiceBear\Avatar;
// From a style definition (JSON-decoded array)
$definition = json_decode(file_get_contents('path/to/style.json'), true);
$avatar = new Avatar($definition, [
'seed' => 'John Doe',
'size' => 128,
]);
echo $avatar; // SVG string
echo $avatar->toDataUri(); // data:image/svg+xml;charset=utf-8,...
use DiceBear\Style;
use DiceBear\Avatar;
use DiceBear\OptionsDescriptor;
$style = new Style($definition);
// Inspect available options for a style
$descriptor = new OptionsDescriptor($style);
$fields = $descriptor->toJSON();
// Create multiple avatars from the same style
$avatar1 = new Avatar($style, ['seed' => 'Alice']);
$avatar2 = new Avatar($style, ['seed' => 'Bob']);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.