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? 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 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? 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
Archived
This topic is now archived and is closed to further replies.