rundiz / serial-number-generator
Generate serial number or random string that is very easy.
Installs: 5 390
Dependents: 0
Suggesters: 0
Security: 0
Stars: 9
Watchers: 2
Forks: 8
Open Issues: 0
Requires
- php: >=5.4.0
This package is auto-updated.
Last update: 2024-10-28 00:41:33 UTC
README
Generate serial number or key or random string with number.
Properties
numberChunks is number of chunks. If you just want to generate random string, set this to 1. It required at least number 1.
Example: If number of chunk is 3. XXXXX-XXXXX-XXXXX
numberLettersPerChunk is number of letters per chunk.
Example: If number of letters per chunk is 2 and number of chunk is 3. XX-XX-XX
separateChunkText is separator text to separate chunks.
Example: If separator is colon. XXXXX:XXXXX:XXXXX:XXXXX:XXXXX
Example
Install
I recommend you to install this library via Composer and use Composer autoload for easily include the files. If you are not using Composer, you have to manually include these files by yourself.
Please make sure that the path to files are correct.
require_once '/path/to/Rundiz/SerialNumberGenerator/SerialNumberGenerator.php';
Usage
Just write this simple code. You can set properties to change some values.
$SerialNumberGenerator = new \Rundiz\SerialNumberGenerator\SerialNumberGenerator(); $serial_number = $SerialNumberGenerator->generate(); unset($SerialNumberGenerator); echo $serial_number;