Created
April 14, 2016 01:32
-
-
Save thrasos/426df29a6fc6c9e062125fa603c02563 to your computer and use it in GitHub Desktop.
Gravatar API in PHP, simple echo.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
*@email - Email address to show gravatar for | |
*@size - size of gravatar | |
*@default - URL of default gravatar to use | |
*@rating - rating of Gravatar(G, PG, R, X) | |
*/ | |
function show_gravatar($email, $size, $default, $rating) | |
{ | |
echo '<img src="http://www.gravatar.com/avatar.php?gravatar_id='.md5($email). | |
'&default='.$default.'&size='.$size.'&rating='.$rating.'" width="'.$size.'px" | |
height="'.$size.'px" />'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment