PHP Echo Random Array and Insert to Database without repeat

后端 未结 4 705
滥情空心
滥情空心 2021-01-29 07:09

I have a code to roll a rand number, and show the winner based on their chance.

    $data = array();
    foreach($getAllUserTicketHistoryJson as $value){
                


        
4条回答
  •  后悔当初
    2021-01-29 07:48

    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

提交回复
热议问题