PHP: srand() function
Description
The srand() function seed the random number generator.
Version:
(PHP 4 and above)
Syntax:
srand(num)
Parameter:
Name | Description | Required / Optional |
Type |
---|---|---|---|
num | Seed value. If omitted, a random value is used. | Optional | Integer |
Return value:
No value is returned.
Example:
<?php
srand(mktime());
echo rand();
?>
View the example in the browser
See also
It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.
https://w3resource.com/php/function-reference/srand.php
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics