开发者

How to randomly generate numbers from 3000 to 80000 ending with zeros only?

I would like to randomly generate numbers like:

3000 4000 5000 etc... between 3000 and 80000.

How might I 开发者_JAVA百科do that?


<?php
echo $your_number = (rand(3,80) * 1000);

demo


I think this is what you mean:

$number = rand(3,80)*1000;

you can test with this

for ($index = 0; $index < 20; $index++) {
     echo (rand(3,80)*1000)."<br />";
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜