fork download
  1. <?php
  2. //от 1 до 100000000 случайные числа, выедем 50;
  3. $length=10;
  4. $start=1;
  5. $end=10;
  6. $array=array();
  7. while (count($array)<$length) {
  8. $array[mt_rand($start,$end)]="";
  9. }
Success #stdin #stdout 0.04s 25956KB
stdin
Standard input is empty
stdout
Array
(
    [0] => 6
    [1] => 7
    [2] => 2
    [3] => 9
    [4] => 4
    [5] => 1
    [6] => 3
    [7] => 8
    [8] => 5
    [9] => 10
)