Hassan Mehmood
Hassan Mehmood

Reputation: 31

php generating random numbers multiple of 10 with min and max

I want to generate random numbers multiple of 10 with minimum and maximum conditions. Example 10, 40, 20, 100, 60. numbers between 10 and 100

Upvotes: -2

Views: 1221

Answers (1)

reza
reza

Reputation: 1507

Following segment will give your desire random number

mt_rand(ceil($min/10) , floor($max/10))*10;

Please try something on your own before asking someone else to help you.

Upvotes: 1

Related Questions