gmp_random_range

PHP 5 >= 5.6.3, PHP 7, PHP 8
gmp_random_range - Random number
Manual
Code Examples

gmp_random_range( GMP|int|string$min, GMP|int|string$max ): GMP

Generate a random number. The number will be between min and max.

min and max can both be negative but min must always be less than max.

Parameters

min

A GMP number representing the lower bound for the random number

max

A GMP number representing the upper bound for the random number

Return Values

A random GMP number.

Example of gmp_random_range

Show all examples for gmp_random_range

PHP Version: