Phpmt_rand () random number function. In the php Tutorial, the mt_rand () random number function mt_rand () returns a random integer using the mersennetwister algorithm. Syntax mt_rand (min, max) indicates that if the optional parameters min and max are not provided, mt_r php Tutorial mt_rand () random number function
Mt_rand () returns a random integer using the mersenne twister algorithm.
Syntax
Mt_rand (min, max) description
If the optional parameters min and max are not provided, mt_rand () returns a pseudo-random number between 0 and rand_max. For example, if you want a random number between 5 and 15 (including 5 and 15), use mt_rand (5, 15 ).
In versions earlier than 3.0.7, max indicates range. In these versions, we need to obtain a random number from 5 to 15, which is the same as the preceding example. The short example is mt_rand (5, 11 ).
*/
$ Rand = mt_rand (0, 1 );
If ($ rand = 0)
{
$ Array = array (, 30 );
}
Elseif ($ rand = 1)
{
$ Array = array (37,400,444 );
}
Foreach ($ array as $ v => $ vv)
{
Echo "$ vvn ";
}
The random mt_rand () random number function mt_rand () returns a random integer using the mersenne twister algorithm. The syntax mt_rand (min, max) indicates that if the optional parameters min and max are not provided, mt_r...