1. Go to this page and download the library: Download gajus/paggern 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/ */
gajus / paggern example snippets
$generator = new \Gajus\Paggern\Generator();
/**
* Generate a set of random codes based on Paggern pattern.
* Codes are guaranteed to be unique within the set.
*
* @param string $pattern Paggern pattern.
* @param int $amount Number of codes to generate.
* @param int $safeguard Number of additional codes generated in case there are duplicates that need to be replaced.
* @return array
*/
$codes = $generator->generateFromPattern('FOO[A-Z]{10}[0-9]{2}', 100);
$lexer = new \Gajus\Paggern\Lexer();
/**
* Tokeniser explodes input into components describing the properties expressed in the pattern.
*
* @param string $pattern
* @param boolean $expand Augment token definition with the haystack of possible values.
* @return array
*/
$lexer->tokenise('[a-c]{3}[1-3]{3}', true);