如何用PHP编写一个随机抽取学生的点名程序?

更新于
2026-09-27 20:01:01
1阅读来源:SEO问题
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计99个文字,预计阅读时间需要1分钟。

如何用PHP编写一个随机抽取学生的点名程序?

使用mt_random()函数(性能优于random()函数)+PHP$min1=1; $max1=51; $stu=mt_rand($min1, $max1); if($stu<26) { $stu=$stu-25; echo '2014585032'.$stu.'号同学'; } else { echo '2014585031'.$stu.'号同学'; }

如何用PHP编写一个随机抽取学生的点名程序?

  1. 用的是mt_random()函数(性能优于random()函数)

<?php $max1=51; $min1=1; $stu=mt_rand($min1,$max1); if($stu>26) { $stu=$stu-25 echo '2014585032'.$stu.'号同学'; } else { echo '2014585031'.$stu.'号同学'; } ?>

本文共计99个文字,预计阅读时间需要1分钟。

如何用PHP编写一个随机抽取学生的点名程序?

使用mt_random()函数(性能优于random()函数)+PHP$min1=1; $max1=51; $stu=mt_rand($min1, $max1); if($stu<26) { $stu=$stu-25; echo '2014585032'.$stu.'号同学'; } else { echo '2014585031'.$stu.'号同学'; }

如何用PHP编写一个随机抽取学生的点名程序?

  1. 用的是mt_random()函数(性能优于random()函数)

<?php $max1=51; $min1=1; $stu=mt_rand($min1,$max1); if($stu>26) { $stu=$stu-25 echo '2014585032'.$stu.'号同学'; } else { echo '2014585031'.$stu.'号同学'; } ?>