mysql - php How to generate a prize based on the prize's winning probability value (0-10000)?
PHP中文网
PHP中文网 2017-05-16 12:59:16
0
1
485

How to generate a prize based on the prize's winning probability value (0-10000) in php?
How to implement the algorithm? Among 10 prizes

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(1)
阿神

Every station understands what you mean, but the easier way to draw immediately is:

1.从0到100随即生成一个整数
2.设置中奖范围 比如10%的中奖率 那么1到10是中奖数字
3.然后根据抽中后的数字判断是几等奖

If you feel it is not safe, you can also increase the range, such as 0 to 10,000, and then set the winning range, etc.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template