<?php
    // 生成一个随机数
    //  从1到100中取得随机数
    for ($index = 0; $index < 100; $index++) {
        $number = (rand() % 100) + 1;
        print("$number   \n");
    }
?>

033-PHP取1-100的随机数

 

相关文章: