Skip to content

Instantly share code, notes, and snippets.

@apphp-snippets
Last active December 12, 2015 09:39
Show Gist options
  • Select an option

  • Save apphp-snippets/4753265 to your computer and use it in GitHub Desktop.

Select an option

Save apphp-snippets/4753265 to your computer and use it in GitHub Desktop.
Using Gravatars In Your Script
<?php
// source: http://www.apphp.com/index.php?snippet=php-using-gravatars-in-your-script
function show_my_gravatar($email, $size, $default, $rating)
{
$params = '?gravatar_id='.md5($email).'&default='.$default.'&size='.$size.'&rating='.$rating;
$output = '<img src="http://www.gravatar.com/avatar.php'.$params.'" width="'.$size.'px" height="'.$size.'px" />';
echo $output;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment