https://xxyh.xiaoli.icu/api/p_random.phphttps://xxyh.xiaoli.icu/api/p_random.php?min=1&max=100&count=1&unique=0min、max 是闭区间,count 最多 100 个,unique=1 时保证不重复(区间不够会直接报错,不会偷偷少给)。
使用 random_int,分布均匀且不可预测,可用于抽奖码、验证码、随机排序。
返回实际区间与实际生成的数量,方便核对。
| 参数名 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
min |
int | 选填 | 1 | 最小值 |
max |
int | 选填 | 100 | 最大值 |
count |
int | 选填 | 1 | 生成个数 |
unique |
int | 选填 | 0 | 传 1 不重复 |
https://xxyh.xiaoli.icu/api/p_random.php
此处将显示接口返回结果…
{
"code": 200,
"msg": "ok",
"data": {
"min": 1,
"max": 100,
"count": 5,
"numbers": [17, 63, 8, 92, 45]
}
}
—