Logo

Programming-Idioms

History of Idiom 69 > diff from v22 to v23

Edit summary for version 23 by :
New PHP implementation by user [dotvezz]

Version 22

2016-02-18, 16:58:01

Version 23

2016-03-02, 13:28:53

Idiom #69 Seed random generator

Use seed s to initialize a random generator.

If s is constant, the generator output will be the same each time the program runs. If s is based on the current value of the system clock, the generator output will be different each time.

Idiom #69 Seed random generator

Use seed s to initialize a random generator.

If s is constant, the generator output will be the same each time the program runs. If s is based on the current value of the system clock, the generator output will be different each time.

Code
srand($s);
Doc URL
http://php.net/manual/en/function.srand.php