PHP code example of topo / range-generator

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

    

topo / range-generator example snippets




rator = new \RangeGenerator\Services\Generator();
$generator->addHandler(new \RangeGenerator\Services\Handlers\Numeric());

$values = $generator->buildRange(5, 10);


[
    5, 6, 7, 8, 9, 10
]




rator = new \RangeGenerator\Services\Generator();
$generator->addHandler(new \RangeGenerator\Services\Handlers\Numeric());

$values = $generator->buildRange('020', '015');


[
    '020', '019', '018', '017', '016', '015'
]




rator = new \RangeGenerator\Services\Generator();
$generator->addHandler(new \RangeGenerator\Services\Handlers\Character());

$values = $generator->buildRange('AAB', 'AAF');


[
    'AAB', 'AAC', 'AAD', 'AAF'
]




rator = new \RangeGenerator\Services\Generator();
$generator->addHandler(new \RangeGenerator\Services\Handlers\NumericWithLabel());

$values = $generator->buildRange('MyZone04 - medium', 'MyZone09 - medium'');


[
    'MyZone04 - medium',
    'MyZone05 - medium',
    'MyZone06 - medium',
    'MyZone07 - medium',
    'MyZone08 - medium',
    'MyZone09 - medium'
]