Posted By

psyne on 08/02/12


Tagged

function Gravatar frontend


Versions (?)

EZ Gravatar


 / Published in: PHP
 

Simple function to grab a gravatar image with a default placeholder set using placehold.it

  1. function get_gravatar($email, $size=128, $default="http://placehold.it/128x128"){
  2. $grav_url = "http://www.gravatar.com/avatar/" . md5( strtolower( trim( $email ) ) ) . "?d=" . urlencode( $default ) . "&s=" . $size;
  3. return $grav_url;
  4. }

Report this snippet  

You need to login to post a comment.