The mt_rand Function
The mt_rand function generates a random
integer within a specified range.
Syntax
mt_rand(from which number, to which number);
Example
Let's generate a random number from 5
to 15:
<?php
echo mt_rand(5, 15);
?>
See Also
-
the
str_shufflefunction,
which shuffles the characters of a string in random order -
the
array_randfunction,
which selects random values from an array -
the
shufflefunction,
which shuffles the elements of an array