Home > Backend Development > PHP Tutorial > PHP implements random roll call program

PHP implements random roll call program

WBOY
Release: 2016-07-25 08:45:33
Original
3427 people have browsed it
The mt_random() function is used (performance is better than random() function)
  1. $max1=51;
  2. $min1=1;
  3. $stu=mt_rand($min1,$max1);
  4. if($stu>26)
  5. {
  6. $stu=$stu- 25
  7. echo '2014585032'.$stu.'Classmate';
  8. }
  9. else
  10. {
  11. echo '2014585031'.$stu.'Classmate';
  12. }
  13. ?>
Copy code

php


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template