Home  >  Article  >  Backend Development  >  Easily implement cute random avatars in php

Easily implement cute random avatars in php

藏色散人
藏色散人forward
2021-09-18 16:07:514246browse

This article will introduce you to how to easily implement cute random avatars in PHP. I hope it will be helpful to friends who need it!

Inadvertently discovered a website that can generate random avatars

www.atoolbox.net/Tool.php?Id=1013

So f12 opened the debugging tool and found

Easily implement cute random avatars in php

Then I opened this link and found that this is the website that generates random avatars
https://multiavatar.com/e27bf0174eae6bfe7756

Easily implement cute random avatars in php

So I changed the md5 value behind the url out of curiosity and found that the avatar changed

Easily implement cute random avatars in php

So I opened the debugging tool with f12 and found

Easily implement cute random avatars in php

Isn’t this a case solved? You can just write a method to generate random avatars

if (!function_exists('make_avatar')) {
    function make_avatar($email)
    {
        $md5_email = md5($email);
        return "https://api.multiavatar.com/{$md5_email}.png";
    }}

perfect! ! ! !
over! ! !

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of Easily implement cute random avatars in php. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:learnku.com. If there is any infringement, please contact admin@php.cn delete