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

PHP implements random roll call program

WBOY
WBOYOriginal
2016-07-25 08:45:333434browse
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


Statement:
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