PHP code example of semiorbit / serial

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

    

semiorbit / serial example snippets


SerialNumber::Generate(string $separator = '') : string

use SemiorbitSerial\Serial;

echo SerialNumber::Generate();

echo SerialNumber::Generate('-');

// OUTPUT:

// CVPKRIJ48NZS4JRO
// CVPK-RIJ4-8NZS-4JRO
 
SerialNumber::Format(string $serial, string $separator = '-'): string

use SemiorbitSerial\Serial;

$serial = '4F93820EFEF290A26489E0AE803A37C0';

echo SerialNumber::Format($serial);

// OUTPUT:
// {4F93820E-FEF2-90A2-6489-E0AE803A37C0}