PHP mt_srand() 函数

PHP 教程 · 2019-01-27 07:57:37

实例

播种随机数生成器:

<?php
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

查看所有标签

Inside the C++ Object Model

Inside the C++ Object Model

Stanley B. Lippman / Addison-Wesley Professional / 1996-5-13 / USD 64.99

Inside the C++ Object Model focuses on the underlying mechanisms that support object-oriented programming within C++: constructor semantics, temporary generation, support for encapsulation, inheritanc......一起来看看 《Inside the C++ Object Model》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试