No cache version.

Caching disabled. Default setting for this page:enabled (code LNG204)
If the display is too slow, you can disable the user mode to view the cached version.

Rechercher une fonction PHP

gmp_random_range

(PHP 5 >= 5.6.3, PHP 7)

gmp_random_rangeRandom number

Description

gmp_random_range ( GMP $min , GMP $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.

PHP: gmp_random_range - Manual Home of Manuel PHP  Contents Haut

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

PHP: gmp_random_range - Manual Home of Manuel PHP  Contents Haut

Examples

Example #1 gmp_random_range() example

<?php
$rand1 
gmp_random_range(0100);    // random number between 0 and 100
$rand2 gmp_random_range(-100, -10); // random number between -100 and -10

echo gmp_strval($rand1) . "\n";
echo 
gmp_strval($rand2) . "\n";
?>

The above example will output:

42
-67

Find a PHP function
Error Infobrol

Can not display this page of the Infobrol website

Type of error (18-01)

Unknown format specifier "&"

Please try again in a few minutes…

Return to the home page




Steph