PHP mt_srand() 函数
PHP 教程
· 2019-01-27 07:57:37
实例
播种随机数生成器:
<?php
mt_srand(mktime());
echo(mt_rand());
?>
mt_srand(mktime());
echo(mt_rand());
?>
定义和用法
mt_srand() 函数播种 Mersenne Twister 随机数生成器。
提示:从 PHP 4.2.0 开始,随机数生成器自动播种,因此没有必要使用该函数。
语法
mt_srand(seed);
| 参数 | 描述 |
|---|---|
| seed | 可选。规定播种值。 |
技术细节
| 返回值: | 无。 |
|---|---|
| 返回类型: | - |
| PHP 版本: | 4+ |
| PHP 更新日志: | PHP 4.2.0:随机数生成器自动播种。 |
点击查看所有 PHP 教程 文章: https://codercto.com/courses/l/5.html
Agile Web Application Development with Yii 1.1 and PHP5
Jeffrey Winesett / Packt Publishing / 2010-08-27
In order to understand the framework in the context of a real-world application, we need to build something that will more closely resemble the types of applications web developers actually have to bu......一起来看看 《Agile Web Application Development with Yii 1.1 and PHP5》 这本书的介绍吧!