PHP Classes

File: test.php

Recommend this page to a friend!
  Classes of Elminson De Oleo   PHP Unique Number Generator   test.php   Download  
File: test.php
Role: Example script
Content type: text/plain
Description: Test file
Class: PHP Unique Number Generator
generateUniquesNumbers
Author: By
Last change:
Date: 4 years ago
Size: 441 bytes
 

Contents

Class file image Download
<?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
)