Randomization

rand([$i1,$i2]) generates a random integer between 0 and getrandmax(), or between $i1 and $i2 if they are supplied. srand($i) seeds the random number generator for rand(). mt_rand ([$i1,$i2]) generates a random integer between 0 and mt_getrandmax(), or between $i1 and $i2 if they are supplied. Using the Mersenne Twister, mt_rand() is four times faster than rand(). mt_srand([$i]) seeds the random number generator for mt_rand(). lcg_value() returns a random float between 0 and 1, using the combined linear congruential generator.

RESETRUNFULL
<!DOCTYPE html><html><head></head>
<body><?php

echo getrandmax()."<br />";
echo mt_getrandmax()."<br />";
echo rand()."<br />";  // already seeded randomly
echo mt_rand(-100,2)."<br />"; // already seeded randomly
echo lcg_value()."<br />";

?></body></html>
Constant Description
M_PI P
M_E e
M_LOG2E log2e
M_LOG10E log10e
M_LN2 loge2
M_LN10 loge10
M_PI_2 P/2
M_PI_4 P/4
M_1_PI 1/P
M_2_PI 2/P
M_SQRTPI sqrt(P)
M_2_SQRTPI 2/sqrt(P)
M_SQRT2 sqrt(2)
M_SQRT3 sqrt(3)
M_SQRT1_2 1/sqrt(2)
M_LNPI logeP
M_EULER Euler constant
NAN Not A Number (float)
INF The Infinite (float)