Easy Tutorial
❮ Func Filesystem Rewind Func Array Prev ❯

PHP srand() Function

PHP Math Reference Manual

Example

Seed the random number generator:


Definition and Usage

The srand() function seeds the random number generator (rand()).

Note: Since PHP 4.2.0, the random number generator is automatically seeded, so there is no need to use this function.


Syntax

Parameter Description
seed Optional. Specifies the seed value.

Technical Details

Return Value: None.
Return Type: -
--- ---
PHP Version: 4+
--- ---
PHP Changelog: PHP 4.2.0: Random number generator is automatically seeded.
--- ---
❮ Func Filesystem Rewind Func Array Prev ❯