I have a code to roll a rand number, and show the winner based on their chance.
$data = array();
foreach($getAllUserTicketHistoryJson as $value){
for($i=0;$i<2;$i++)
{
chance($getAllUserTicketHistoryJson[rand(0,count($getAllUserTicketHistoryJson))]);
}
function chance($arrWinner = array()){
// the array for winner is
echo " Winner array ";
print_r($arrWinner);
echo "
";
}
try this... and if there is an errer... then let me know ... or add screen short of error if possible