PHP 8.1.30 Released!

Random\Randomizer::getInt

(PHP 8 >= 8.2.0)

Random\Randomizer::getIntGet a uniformly selected integer

说明

public Random\Randomizer::getInt(int $min, int $max): int

警告

本函数还未编写文档,仅有参数列表。

参数

min

The lowest value to be returned.

max

The highest value to be returned.

返回值

A uniformly selected integer from the closed interval [min, max]. Both min and max are possible return values.

错误/异常

示例

示例 #1 Random\Randomizer::getInt() example

<?php
$r
= new \Random\Randomizer();

// Random integer in range:
echo $r->getInt(1, 100), "\n";
?>

以上示例的输出类似于:

42

参见

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top