Skip to content

Checking your reading list…

Retry

Stay curious. Build better.

Appearance

Choose how BestHub looks on this device.

Changes apply immediately.

Search articles

Open Discover with these filters

Suggested searches

Generating Random Avatars with Multiavatar API in PHP

The article explains how to discover the Multiavatar service, use browser developer tools to modify the MD5 hash in the URL to obtain different avatars, and provides a concise PHP function that returns a random avatar URL based on an email address.

While browsing, the author discovered a website that can generate random avatars (www.atoolbox.net/Tool.php?Id=1013) and later identified the actual service at https://multiavatar.com/ with a unique MD5 hash in the URL.

Using the browser's developer tools, they observed that changing the MD5 part of the URL produces different avatar images, confirming the generation mechanism.

Based on this insight, a simple PHP helper function is provided, which computes the MD5 hash of an email address and returns the corresponding Multiavatar PNG URL.

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

This function enables developers to easily obtain a random avatar for any user without external dependencies.

About this article

For questions about attribution, corrections or content rights, please contactadmin@besthub.devand we will review it promptly.

APIavatarMultiavatar

Discussion 0

Questions, practical examples and thoughtful responses.

Open full discussion