Jump to: navigation, search

Php mt srand

From w3cyberlearnings

Contents

PHP function mt_srand

This function sets the seed for better random number.

Syntax mt_srand

X is a number.

mt_srand(X)

Note

As up to PHP 4.2.0, no need to seed the random number generator with srand() or mt_sand(). As it is done automatically.

Example 1

<?php
mt_srand(mktime());
echo mt_rand();
?>

Output

45113821


Related Links


Navigation
Web
SQL
MISC
References