probability test of red envelopes in/*** @FileName rand.php pumping **/Header"content-type:text/html; Charset=utf-8 ");/*** Draw * @param int $total 1 for hundred win 2 for One-second winning rate 3 for One-third winning rate and so on ... * * functiongetreward($total=ten){if($total==1){return1;}$win 1= ($total-1)/ -;$other= ($total-1)-$win 1;$return=Array(); for($i=0;$i<$win 1;$i++){$return[] =1;//Winning} for($n=0;$n<$other;$n++){$return[] =0;//Not winning}//print_r ($return);Shuffle$return);//Reorder elements in the array in random orderreturn$return[Array_rand ($return)];}$data= Getreward ();Echo$data; die;?>
'). addclass (' pre-numbering '). Hide (); $ (this). addclass (' has-numbering '). Parent (). append ($numbering); for (i = 1; i <= lines; i++) {$numbering. Append ($ ('
'). Text (i)); }; $numbering. FadeIn (1700); }); });
The above introduces the pumping probability of PHP, including the content, I hope that the PHP tutorial interested in a friend to help.