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 :  Laravel Vue JS CRUD Example Tutorial From Scratch

Example 1: How To Create Avatar Images in PHP

<?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

<?php
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

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

echo "<pre>";
print_r($i);
echo "</pre>";

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

Example 4: PHP text avatar Plugins

<?php
$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 Functions - MY SQL Connects and Global Variable

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

Summary

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 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.

Recommended For You.

Laravel Route pass multiple Parameters Examples
Today, We want to share with you Laravel Route pass multiple Parameters Examples.In this post we will show you laravel

Add a Comment

Your email address will not be published. Required fields are marked *