PHP Tutorial Mt_rand () random number function
Mt_rand () returns a random integer using the Mersenne twister algorithm.
Grammar
Mt_rand (Min,max) description
If no optional parameter min and Max,mt_rand () are provided, the pseudo-random number between 0 and Rand_max is returned. For example, want a random number between 5 and 15 (including 5 and 15), with Mt_rand (5, 15).
In the previous version of 3.0.7, Max was meant to be range. To get the same random number from the previous example of 5 to 15 in these versions, the short example is Mt_rand (5, 11).
*/
$rand = Mt_rand (0,1);
if ($rand ==0)
{
$array = Array (41,20,26,29,30);
}
ElseIf ($rand ==1)
{
$array = Array (38,42,37,400,444);
}
foreach ($array as $v = $VV)
{
echo "$VVN";
}
http://www.bkjia.com/PHPjc/445361.html www.bkjia.com true http://www.bkjia.com/PHPjc/445361.html techarticle The PHP tutorial Mt_rand () random number function Mt_rand () returns a random integer using the Mersenne twister algorithm. Syntax Mt_rand (MIN,MAX) illustrates if optional parameters min and max,mt_r are not provided ...