PHP code example of robthree / humanoid
1. Go to this page and download the library: Download robthree/humanoid 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/ */
robthree / humanoid example snippets
use RobThree\HumanoID\HumanoIDs;
// Create new instance of HumanoID via the builder
$zooIdGen = HumanoIDs::zooIdGenerator();
// Convert ID to HumanoID
$zooId = $zooIdGen->create(96712);
echo sprintf("HumanoID : %s\n", $zooId);
// Convert back to ID
$id = $zooIdGen->parse($zooId);
echo sprintf("Decoded ID : %d\n", $id);