Return to Snippet

Revision: 27564
at June 16, 2010 22:15 by JackWH


Initial Code
<?php
$gravatar_link = 'http://www.gravatar.com/avatar/' . md5($email) . '?s=32';
echo '<img src="' . $gravatar_link . '" alt="gravatar"/>';
?>

Initial URL


Initial Description
Just set the variable `$email` to the user's email address. Hey presto! A Gravatar image!

You can also change the size by adjusting the `s=32` variable. Size is in pixels.

Initial Title
Fetch a Gravatar Image

Initial Tags
php, image

Initial Language
PHP