PHP code example of mikhail-arkhipov / php-generator-id

1. Go to this page and download the library: Download mikhail-arkhipov/php-generator-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/ */

    

mikhail-arkhipov / php-generator-id example snippets


use MikhailArkhipov\PhpGeneratorId\GeneratorId;

$idGenerator = new generatorId();
/**
 * @param int $idLength 
 * default = 8
 * @return string
 */
$uniqueId = $idGenerator->generate();

echo $uniqueId; // "5f9f-3c7d"