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://www.codercto.com/courses/l/5.html

查看所有标签

Compilers

Compilers

Alfred V. Aho、Monica S. Lam、Ravi Sethi、Jeffrey D. Ullman / Addison Wesley / 2006-9-10 / USD 186.80

This book provides the foundation for understanding the theory and pracitce of compilers. Revised and updated, it reflects the current state of compilation. Every chapter has been completely revised ......一起来看看 《Compilers》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

html转js在线工具
html转js在线工具

html转js在线工具