$max_num = 10000000;
$num_count = 100000;
$array = [];
while (count($array) < $num_count) {
$r = rand(0, $max_num);
$array[$r] = 1;
}
$array = array_keys($array);
function fillArrayNumbers(int $count = 100): array
{
$arr = [];
for ($i = 0; $i < $count-1;)
{
$alreadyThere = false;
$newRandomValue = random_int(0, $count);
for ($j = 0; $j < $i; $j++)
{
if ($arr[$j]==$newRandomValue)
{
$alreadyThere = true;
break;
}
}
if (!$alreadyThere)
{
$arr[$i] = $newRandomValue;
$i++;
}
}
return $arr;
}
Берём и пользуемся=);