random digit with seed php

42

<?php
$FourDigitRandomNumber = mt_rand(1111,9999);
echo $FourDigitRandomNumber;
?>
srand(12345);
$randomNumbers = [];

for ($i = 0; $i < 5; ++$i) {
  $randomNumbers[] = rand(1, 100);
}

print_r($randomNumbers);

Comments

Submit
0 Comments