PHP code example of lostmilky / snowflake

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

    

lostmilky / snowflake example snippets



use Snowflake;

$arr = [];
for ($i=0; $i<500; $i++) {
    $arr[] = Snowflake::snId();
}

foreach ($arr as $id) {
    $s = Snowflake::parseSnId($id, true);
    dump($id.' '. $s['seq_id']);
}