elminson/generateuniquesnumbers

This generate an array of uniques numbers in a range

v1.2 2020-04-08 04:53 UTC

This package is auto-updated.

Last update: 2024-11-08 16:16:27 UTC


README

<?php 

require_once __DIR__ . '/vendor/autoload.php'; // Autoload files using Composer autoload

use Elminson\GenerateUniquesNumbers;

$array = [1, 2, 3, 4];

$gen = new generateUniqueNumbers();

$gen->setMax(10);

$gen->setExclude($array);

$gen->setTopRandomNumber(5);

$gen->generate();

print_r($gen->getCurrentNumbers());

//Output
Array
(
    [0] => 0
    [1] => 9
    [2] => 6
    [3] => 10
    [4] => 5
)