in reply to
Need help with number generator
$randnum = int(rand(100));
if ( $randnum > 20 ) #80%
#stuff for 1
if ( $randnum > 90 ) #10%
#stuff for 2 and 3
It would do #stuff for 1
_and_ #stuff for 2 and 3 10% of the time.
And 20% of the time it would do nothing...
Remember to think before you code! :-P
Results (448 votes),