32
identicon
identicon
SYNOPSIS
identicon($name, $size=48)
DESCRIPTION
identicon returns the PNG of a unique square image of $size pixels generated from $name.
CODE
PHP Identicons on SourceForge.
EXAMPLE
- define('AVATAR_SIZE', 24);
- define('AVATARS_DIR', ROOT_DIR . DIRECTORY_SEPARATOR . 'avatars');
- function user_create_avatar($name) {
- require_once 'identicon.php';
- $img=identicon($name, AVATAR_SIZE);
- $r = imagepng($img, AVATARS_DIR . DIRECTORY_SEPARATOR . $name . '.png');
- return $r;
- }
izend
Comments