PHP code example of sinevia / php-library-uid

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

    

sinevia / php-library-uid example snippets


\Sinevia\Uid::humanUuid();       // 32 digits - YYYYMMDD-HHMM-SSMM-MMMMRRRRRRRRRRR
\Sinevia\Uid::nanoUid();         // 23 digits - YYYYMMDD-HHMMSS-MMMMMM-NNN
\Sinevia\Uid::microUid();        // 20 digits - YYYYMMDD-HHMMSS-MMMMMM
\Sinevia\Uid::secUid();          // 14 digits - YYYYMMDD-HHMMSS
\Sinevia\Uid::timestampUid();    // Unix time (seconds since 1 Jan 1970)

\Sinevia\Uid::timestampUidWithRandomPostFix(12); // Unix time + 12 random digits

\Sinevia\Uid::isHumanUid(1);
\Sinevia\Uid::isNanoUid(1);
\Sinevia\Uid::isMicroUid(1);
\Sinevia\Uid::isSecUid(1);