PHP » PYTHON |
login |
register |
about
|
import random random.randint(min, max) The "random" module also has functions for generating other kinds of random numbers. rand(PHP 4, PHP 5) rand — Generate a random integer Description
int rand
( void
)
int rand
( int $min
, int $max
)
If called without the optional min , max arguments rand() returns a pseudo-random integer between 0 and getrandmax(). If you want a random number between 5 and 15 (inclusive), for example, use rand(5, 15).
Parameters
Return ValuesA pseudo random value between min (or 0) and max (or getrandmax(), inclusive). Examples
Example #1 rand() example
<?php The above example will output something similar to: 7771 22264 11
See Also
|
more
Recently updated
more
Most requested
more
Last requests
|