PHP code example of visus / cuid2
1. Go to this page and download the library: Download visus/cuid2 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/ */
visus / cuid2 example snippets
ew (default length of 24)
$cuid = new Visus\Cuid2\Cuid2();
// implicit casting
echo $cuid; // apr5hhh4ox45krsg9gycbs9k
// explicit casting
echo $cuid->toString(); // apr5hhh4ox45krsg9gycbs9k
// new (with custom length)
$cuid = new Visus\Cuid2\Cuid2(10);
echo $cuid; // pekw02xwsd