fork(1) download
  1. <?php
  2.  
  3. function gerarCartao(){
  4. $numeros = range(0, 59);
  5. shuffle($numeros);
  6. $cartoes = array();
  7.  
  8. $cartoes = array_chunk($numeros, 7);
  9. array_pop($cartoes);
  10. return $cartoes;
  11.  
  12. }
  13.  
  14.  
  15. print_r(gerarCartao());
Success #stdin #stdout 0.01s 82880KB
stdin
Standard input is empty
stdout
Array
(
    [0] => Array
        (
            [0] => 21
            [1] => 3
            [2] => 36
            [3] => 2
            [4] => 53
            [5] => 38
            [6] => 10
        )

    [1] => Array
        (
            [0] => 24
            [1] => 46
            [2] => 29
            [3] => 18
            [4] => 11
            [5] => 59
            [6] => 52
        )

    [2] => Array
        (
            [0] => 1
            [1] => 48
            [2] => 4
            [3] => 20
            [4] => 30
            [5] => 43
            [6] => 33
        )

    [3] => Array
        (
            [0] => 47
            [1] => 6
            [2] => 50
            [3] => 9
            [4] => 58
            [5] => 15
            [6] => 22
        )

    [4] => Array
        (
            [0] => 35
            [1] => 51
            [2] => 44
            [3] => 40
            [4] => 12
            [5] => 0
            [6] => 31
        )

    [5] => Array
        (
            [0] => 23
            [1] => 56
            [2] => 55
            [3] => 5
            [4] => 42
            [5] => 37
            [6] => 14
        )

    [6] => Array
        (
            [0] => 13
            [1] => 26
            [2] => 28
            [3] => 41
            [4] => 32
            [5] => 17
            [6] => 7
        )

    [7] => Array
        (
            [0] => 57
            [1] => 49
            [2] => 19
            [3] => 45
            [4] => 34
            [5] => 27
            [6] => 54
        )

)