PHP 7.2.9 Released

getrandmax

(PHP 4, PHP 5, PHP 7)

getrandmax显示随机数最大的可能值

说明

int getrandmax ( void )

返回调用 rand() 可能返回的最大值。

返回值

rand() 返回 随机数可能返回的最大值

参见

add a note add a note

User Contributed Notes 1 note

up
-47
navjot at nspeaks dot com
3 years ago
The maximum value returned by getrandmax() is valid only if you call the rand() function without any parameter.

For eg

<?php
getrand
(35000, 50000);
?>

would still work because you have specified the limits even though getrandmax() returned 32767.
To Top