GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - dmester/jdenticon-php: PHP library for generating identicons as PNG and SVG.

BranchesTags
Open more actions menu

Latest commit

 

History

74 Commits
74 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
src
src
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
composer.json
composer.json
 
 

Repository files navigation

Jdenticon-php

PHP library for generating highly recognizable identicons.

Sample identicons

Test Status Total Downloads

Features

Jdenticon-php is a PHP port of the JavaScript library Jdenticon.

  • Renders identicons as PNG or SVG with no extension requirements
  • Runs on PHP 7.4 and later (use Jdenticon package version 1.0.2 for compatibility with PHP 5.3-7.3)

Live demo

https://jdenticon.com

Getting started

Using Jdenticon is simple. Follow the steps below to integrate Jdenticon into your website.

1. Install the Jdenticon Composer package

The easiest way to get started using Jdenticon for PHP is to install the Jdenticon Composer package.

composer require jdenticon/jdenticon

2. Create a php file that will serve an icon

Now create a file that you call icon.php and place it in the root of your application. Add the following content to the file.

<?php
include_once("vendor/autoload.php");

// Set max-age to a week to benefit from client caching (this is optional)
header('Cache-Control: max-age=604800');

// Parse query string parameters
$value = $_GET['value'];
$size = min(max(intval($_GET['size']), 20), 500);

// Render icon
$icon = new \Jdenticon\Identicon();
$icon->setValue($value);
$icon->setSize($size);
$icon->displayImage('png');

3. Use icon.php

Open up your favourite browser and navigate to http://localhost:PORT/icon.php?size=100&value=anything. An identicon should be displayed. Try to change the url parameters to see the difference in the generated icon.

Other resources

API documentation

For more usage examples and API documentation, please see:

https://jdenticon.com/php-api.html

License

Jdenticon-php is released under the MIT license.

About

PHP library for generating identicons as PNG and SVG.

jdenticon.com

Topics

avataridenticonjdenticonphp

Resources

Readme
MIT license
Activity

Stars

62 stars

Watchers

3 watching

Forks

10 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.