Created
January 5, 2018 10:13
-
-
Save gladchinda/46bc1cc217125f88d221b829a647c9f7 to your computer and use it in GitHub Desktop.
Code to test how to use affixes with the Keygen package.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require __DIR__ . '/vendor/autoload.php'; | |
use Keygen\Keygen; | |
// Prefix (inclusive enabled) | |
echo Keygen::numeric(12)->prefix('TM-')->generate(); // e.g TM-218624395 | |
// Prefix (inclusive disabled) | |
echo Keygen::numeric(12)->prefix('TM-')->generate(true); // e.g TM-382104609735 | |
// Suffix (inclusive enabled) | |
echo Keygen::alphanum(20)->suffix('.me')->generate(); // e.g 5UpwTe7cl268s31c9.me | |
// Suffix (inclusive disabled) | |
echo Keygen::alphanum(20)->suffix('.me')->generate(true); // e.g X1QkHm5OAI9q3F3VxNv8.me | |
// Combined (inclusive enabled) | |
echo Keygen::numeric(15)->prefix('TM-')->suffix('.me')->generate(); // e.g TM-101636457.me |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment