PHP code example of hylianshield / number-generator

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

    

hylianshield / number-generator example snippets



use HylianShield\NumberGenerator\NumberGenerator;

$generator = new NumberGenerator();
$generator->generateNumber(); // Number between 0 and PHP_INT_MAX
$generator->generateNumber(12); // Number between 12 and PHP_INT_MAX
$generator->generateNumber(42, 1337); // Number between 42 and 1337

// List of 10 numbers between 42 and 1337.
$numbers = iterator_to_array(
    $generator->generateList(10, 42, 1337)
);

> ./examples/basic-range.php '10' '42' '1337'
685
993
472
977
876
997
459
281
529
1287