Skip to main content

Google Style Text Avatar using PHP Example

Today, We want to share with you Google Style Text Avatar using PHP Example.In this post we will show you PHP Profile Name Initials (First Letter) Like Google, hear for php initial avatar generator Example we will give you demo and example for implement.In this post, we will learn about Create Name Initials and Custom Profile Pictures without Name Initial Images using PHP with an example.

Google Style Text Avatar using PHP Example

There are the Following The simple About Google Style Text Avatar using PHP Example Full Information With Example and source code.

As I will cover this Post with live Working example to develop PHP – Make Avatar, Profile Picture, so the some major files and Directory structures for this example is following below.

Also Read :  Golang Float64s function - Math function

Example 1: How To Create Avatar Images in PHP


function getNameWithLastname($name){
$getnames = explode(' ', $name);
return substr($getnames[0], 0,1).substr($getnames[1], 0,1);

$name = "Jaydeep Gondaliya";
echo getNameWithLastname($name);

Example 2: default avatars with username initials

function nameWithLastInitial($name) {
    $usernames = explode(' ', $name);
    $last_name = array_pop($usernames);
    $first_name = array_pop($usernames);
    $first_initial = $first_name[0];
    $last_initial = $last_name[0];
    return $first_initial.$last_initial;

$name = "Jaydeep Gondaliya";
echo nameWithLastInitial($name);

Example 3: text avatar generator

$name ="Jaydeep Gondaliya"; 
preg_match_all('~\b(\S){1}~', $name, $i); 

echo "<pre>";
echo "</pre>";

echo $i[1][0].$i[1][1];  

Example 4: PHP text avatar Plugins

$name = "Jaydeep M. Gondaliya";
list($fname, $lname) = explode(' ', $name,2);
echo "Member FName: $fname, Member L Name: $lname";

Example 5: Add text to an image with PHP

$UsernameStr = "Jaydeep Gondaliya Mansukhbhai";

$result = explode(" ",$UsernameStr);

echo $result[0]; //Jaydeep
echo $result[1]; //Gondaliya
echo $result[2]; //Mansukhbhai

Angular 6 CRUD Operations Application Tutorials

Read :

Also Read :  PHP Laravel MySQL Joins Tutorial with Examples

Related Search: How To Create Avatar Images in PHP,Add text to an image with PHP,Letter Avatars,text avatar generator,google initial avatar,letter avatar generator online,initials avatar generator online,default avatars with username initials,letter avatar css,javascript avatar generator,default avatar generator,PHP Profile Name Initials (First Letter) Like Google,php initial avatar generator Example,Google Style Text Avatar using PHP Example


You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Google Style Text Avatar using PHP Example.
I would like to have feedback on my 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.

Web Developer

Hi, I’m Web developer, PHP is the most popular Programming & Web Development blog. Our mission is to provide the best online resources on programming and web development.Any visitors of this site are free to browse our tutorials, live demos, Examples and download scripts.If you have a project that you want to get started, launch quickly, contact me. Email : [email protected]