Generate a random integer. You can specify the min and max values (inclusive) or by default it will be between zero and getrandmax().

It was once required to “seed” the generator before calling this function for the first time but that became unnecessary way back in PHP 4.2.0

// results will vary, of course
$n = rand();          // 1376159191
$n = rand();          // 1599155550
$n = rand( 17, 403 ); // 254
$n = rand( -55, -2 ); // -32