文字

getrandmax

(PHP 4, PHP 5)

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

说明

int getrandmax ( void )

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

返回值

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

参见

  • rand() - 产生一个随机整数
  • srand() - 播下随机数发生器种子
  • mt_getrandmax() - 显示随机数的最大可能值

用户评论:

[#1] navjot at nspeaks dot com [2015-07-31 14:09:53]

The maximum value returned by getrandmax() is valid only if you call the rand() function without any parameter. 

For eg

<?php
getrand
(3500050000);
?>


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

上一篇: 下一篇: