PHP design welfare lottery lucky number active Native

Source: Internet
Author: User
Using php's complete random design, each refresh has a different honor number. try it and don't forget neo after you make a fortune ~~~ <? Phpfor ($ n = 1; $ n <= 5; $ n ++) {echo "th ". $ n. "Note"; $ string = ""; // Initialization string for ($ I = 1; $ I <= 7; $ I ++) {mt_srand (double) m adopts a complete and random php design, and each refresh has a different honor number. try it and don't forget neo after you make a fortune ~~~
<? Php
For ($ n = 1; $ n <= 5; $ n ){
Echo 'nth. $ n. 'Note ';
$ String = ''; // Initialization string
For ($ I = 1; $ I <= 7; $ I ){
Mt_srand (double) microtime () * 1000000); // participates in the time factor, in order to fulfill the point of one second when the number of seeds is messy
$ Random = mt_rand (); // generates a random number between 1 and 30.
If (eregi ($ random, $ string) {// check whether this number already exists
$ I --;
Continue; // jump out of the loop and return to the start point of the decision.
}
Else {
$ String = $ string. ','. $ random;
Echo $ random ,'';}
}
Echo '<BR> ';
}
?>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.