I have a code to roll a rand number, and show the winner based on their chance.
$data = array();
foreach($getAllUserTicketHistoryJson as $value){
The winning ticket number $winner_count is ticket number: {$winner[$winner_count]}";
$winners[$round_number][] = $winner[$winner_count];
$winner_count++;
}
$winner_count = 0;
}
var_dump($winners);
?>
$ticket_numbers will be filled from the JSON feed. Each time the main loop is run, the required number of winners are picked, their ticket numbers are removed from the list of potential winners. An array of winners is generated which will be used for entering the winners into the database. Each ticket can only win once.