You are here : phpmathmt_srand

mt_srand() - math

Seeds the random number generator with
   seed or with a random value
   if no seed is given.
Parameters :
  • seed - An arbitrary integer seed value.

  • Syntax

    void mt_srand
         ([ int $seed
       ] )


    Example

    <?php// seed with microsecondsfunction make_seed(){  list($usec, $sec) = explode(' ', microtime());  return $sec + $usec * 1000000;}mt_srand(make_seed());$randval = mt_rand();?>


    Output / Return Value


    Limitations


    Alternatives / See Also


    Reference