pH2Gravatar
The simplest Gravatar PHP package
An easy and elegant way to generate gravatar profile photos from email addresses
β
Requirements
- PHP 7.1 or higher.
π
How to install it?
With composer,
composer require ph-7/ph2gravatar
π
How to use it?
require __DIR__ . '/vendor/autoload.php';
use PH7\PH2Gravatar\Gravatar\Image;
?>
<!-- Here, we leave the default parameters. https://en.gravatar.com/site/implement/images/ -->
<img src="<?php echo Image::get('[email protected]'); ?>" alt="My gravatar image" />
<!-- Set gravatar image size to 400px -->
<img src="<?php echo Image::get('[email protected]', ['size' => 400]); ?>" alt="My gravatar image" />
require __DIR__ . '/vendor/autoload.php';
use PH7\PH2Gravatar\Gravatar;
echo Gravatar::get('[email protected]', [
'size' => 80,
'rating' => 'pg',
'display' => 'retro'
]);
πͺ
Author
I'm Pierre-Henry Soria. A passionate, zen & dedicated software engineer
π
License
pH2Gravatar is distributed under MIT license