1. Go to this page and download the library: Download lemmon/id library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
lemmon / id example snippets
use Lemmon\Id\Id;
$id = Id::generate(); // "kwe7wndx4t" — canonical, lowercase
echo strtoupper($id); // "KWE7WNDX4T" — display form
echo Id::chunk(strtoupper($id)); // "KWE7-WNDX-4T"
// Accepting a transcribed ID back:
$input = Id::normalize('KWE1-WNDX-4T'); // user misread 7 as 1 → repaired
if (!Id::isValid($input, 10) || !Id::verifyCheck($input)) {
// Reject malformed, wrong-length, or mistyped input.
}
Id::generate(); // default blocklist
Id::generate(10, [...Id::DEFAULT_BLOCKLIST, 'merch']); // add an app-specific term
Id::generate(10, []); // disable filtering
Id::generate(); // no limit (default)
Id::generate(10, Id::DEFAULT_BLOCKLIST, 2); // "kwwe..." ok, "kwwwe..." retried
Id::generate(10, Id::DEFAULT_BLOCKLIST, 1); // no two adjacent characters may match
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.