Home > Backend Development > PHP Tutorial > Easily implement cute random avatars in php

Easily implement cute random avatars in php

藏色散人
Release: 2023-04-10 16:58:01
forward
4293 people have browsed it

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";
    }}
Copy after login

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!

Related labels:
php
source:learnku.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template