开发者

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

开发者 https://www.devze.com 2023-04-10 04:48 出处:网络
I would like to randomly generate numbers like: 3000 4000 5000 etc... between 3000 and 80000. How might I 开发者_JAVA百科do that?<?php

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

精彩评论

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

关注公众号