srand ($seed)Parameters:This function takes one seed parameter. This parameter is optional and is of type integer. It defines the initial value.Return value:This function does not return any value.Examples:
Input: srand (time()); Output: 1793542495 Input: srand (5) Output: 3The following programs illustrate the srand() function in PHP:
srand (time());
echo
(rand());
?>
Output:1793542495
srand (5);
echo
(rand (1, 10));
?>
Output:3
- The srand() function can be used to generate random numbers.
- The srand() function does not generate the same sequence of random numbers as the rand() function.
- It has no return value.
http://php.net/manual/en/function.srand. php