php 如何根据奖品的中奖概率值(0-10000)产生一个奖品?算法如何实现? 10个奖品里面
认证高级PHP讲师
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.
Every station understands what you mean, but the easier way to draw immediately is:
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.