Fetch a Gravatar Image


/ Published in: PHP
Save to your folder(s)

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.


Copy this code and paste it in your HTML
  1. <?php
  2. $gravatar_link = 'http://www.gravatar.com/avatar/' . md5($email) . '?s=32';
  3. echo '<img src="' . $gravatar_link . '" alt="gravatar"/>';
  4. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.