Monkuar Posted February 3, 2012 Share Posted February 3, 2012 I have a scratch ticket system I made, and this code generates if a user will win or not. $card1 = rand(1,5); $card2 = rand(1,5); if($card1 == "1" && $card2 == "1"){ //I WON!!! do my queries here/etc }else{ //Failed } Okay, now how can I make it so I can set it up so I can change it to 5% of winning, 10% of winning, 15% of winning, 20% of winning/etc so on? instead of just a random count function? Quote Link to comment https://forums.phpfreaks.com/topic/256353-how-can-raise-my-percentage/ Share on other sites More sharing options...
The Little Guy Posted February 3, 2012 Share Posted February 3, 2012 This was very helpfull IMO: http://stackoverflow.com/questions/8041356/what-is-the-most-efficient-way-to-make-and-odds-system Quote Link to comment https://forums.phpfreaks.com/topic/256353-how-can-raise-my-percentage/#findComment-1314250 Share on other sites More sharing options...
Andy-H Posted February 4, 2012 Share Posted February 4, 2012 You mean depending on a variable? or the prize is based on the percentage of that occurrence? Quote Link to comment https://forums.phpfreaks.com/topic/256353-how-can-raise-my-percentage/#findComment-1314266 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.