Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Pegando imagem do Gravatar com PHP
<?php
function getAvatar() {
$email = 'seu@email.com.br'; // e-mail de cadastro para pegar as imagens
$default = '_img/sem-imagem-perfil.png'; // imagem alternativa para se não existir
$size = 25; // tamanho da imagem
$grav_url = "http://www.gravatar.com/avatar/" . md5( strtolower( trim( $email ) ) ) .
"?d=" . urlencode( $default ) . "&s=" . $size;
return $grav_url;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.