Today, We want to share with you Get Gravatar Image Using PHP Example.In this post we will show you PHP Image Requests – Gravatar, hear for How to Get Gravatar Image Using PHP we will give you demo and example for implement.In this post, we will learn about Get A Users Gravatar Image Via PHP with an example.
Get Gravatar Image Using PHP Example
Contents
There are the Following The simple About Get Gravatar Image Using PHP Example Full Information With Example and source code.
As I will cover this Post with live Working example to develop gravatar url from email, so the some get gravatar by email for this example is following below.
Get Gravatar Image with PHP
Gravatar stands for “Globally Recognized Avatar”. PHP Image Requests – Gravatar is the very well known Best service to display A Users Gravatar Image avatar globally.
index.php
<?php $email = "[email protected]"; $hash = md5( strtolower( trim( $email ) ) ); $size = 150; echo $grav_url = "https://www.gravatar.com/avatar/" . $hash . "?s=" . $size; ?> <!DOCTYPE html> <html> <head> <title>Display Gravator Image in PHP - Pakainfo.com</title> </head> <body> <h3>Get A Users Gravatar Image Via PHP</h3> <img src="<?php echo $grav_url; ?>"> </body> </html>
Setting The Size
//set a Dynamic size variable $size = "150"; //echo gravatar(PHP Image Requests - Gravatar) echo "<img src='//gravatar.com/avatar/$userEmailHash?s=$size'>";
Get Gravatar Image with PHP
//start with some simple Gravatar settings $getEmail = "[email protected]"; $size = "150"; $profileDefault = "images/defaultmy-logo.png"; $getEmail = strtolower($getEmail); $userEmailHash = md5($getEmail); $profileDefault = urlencode($profileDefault); //echo gravatar echo "<img src='//gravatar.com/avatar/$userEmailHash?d=$profileDefault&s=$size'>";
Angular 6 CRUD Operations Application Tutorials
Read :
Summary
You can also read about AngularJS, ASP.NET, VueJs, PHP.
I hope you get an idea about Get Gravatar Image Using PHP Example.
I would like to have feedback on my Pakainfo.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, donβt forget to share.
I am Jaydeep Gondaliya , a software engineer, the founder and the person running Pakainfo. I’m a full-stack developer, entrepreneur and owner of Pakainfo.com. I live in India and I love to write tutorials and tips that can help to other artisan, a Passionate Blogger, who love to share the informative content on PHP, JavaScript, jQuery, Laravel, CodeIgniter, VueJS, AngularJS and Bootstrap from the early stage.