Could somebody tell me if this is working as it should be:
Code: Select all
$i = 0;
while ($i < 1000000) {
if (isset($rand)) {
$rand2 = $rand;
}
$rand = mt_rand();
if (isset($rand2)) {
if ($rand < $rand2) {
$lowest = $rand;
}
if ($rand > $rand2) {
$highest = $rand;
}
}
$i++;
}
echo "The lowest random number generated was: ", $lowest, "\n";
echo "The highest random number generated was: ", $highest, "\n";