PHP code example of byjg / shortid
1. Go to this page and download the library: Download byjg/shortid 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/ */
byjg / shortid example snippets
$shortid = \ByJG\Utils\ShortId::fromNumber(81717788171667188198);
// Will write: Qi0yuM2uKwJb
$shortid = \ByJG\Utils\ShortId::fromNumber(
81717788171667188198,
\ByJG\Utils\ShortId::$MAP_NUMBERS_FIRST
);
// Will write: G8QokCSkAmz1
composer
vendor/bin/phpunit