dimanche 29 mars 2015

Easy PHP random code

I'm new there :) I was trying to create a random code in PHP with following results in decimals (precision 2)



From 1.10 to 1.15 = 40%
From 1.16 to 1.20 = 30%
From 1.21 to 1.25 = 20%
From 1.26 to 1.30 = 10%


That's my actual code:



$low = 1.1
$high = 1.3
$multiplier = mt_rand($low*100,$high*100)/100;


Help me please? :(





Aucun commentaire:

Enregistrer un commentaire