You can use php to randomly generate a lucky two-color ball number. I don't want to tell you that I am also a two-color ball enthusiast. I often buy it, but I haven't won the first prize yet, haha. Here we will introduce you to two ways to randomly generate a lucky two-color ball number using php. I am also a two-color ball enthusiast and often buy it, but I have never won the first prize yet, haha.
Here we will introduce two methods to randomly generate a lucky two-color ball number using php for your reference. In the new year, I wish you a grand prize and a fortune.
Method 1
The code is as follows:
/*
Generate a random color ball number
*/
$ Red = array (, 33 );
$ Blue = array );
For ($ I = 0; $ I <6; $ I ++ ){
$ Index = rand (0, 32-$ I );
$ RedBall [] = $ red [$ index];
Unset ($ red [$ index]);
For ($ k = $ index; $ k $ Red [$ k] = $ red [$ k + 1];
}
}
Asort ($ redBall );
?>
Foreach ($ redBall as $ v ){
Echo $ v ."";
}
?>
Echo $ blue [rand (0, 15)];
?>
Method 2
The code is as follows:
/*
Generate a random color ball number
*/
Echo"
";
Echo"
";
$ Red1 = range (1, 33 );
$ Blue1 = mt_rand (1, 6 );
$ Sc1 = array_rand ($ red1, 6 );
?>
Foreach ($ sc1 as $ v ){
Echo "$ v ";
}
?>
Echo "$ blue1 ";
?>
The previous method is relatively troublesome. if you need it, please refer to the second method.
Bytes. Here we will introduce two methods to randomly generate a lucky two-color ball number using php...