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 />";
}
精彩评论