AndrewDavidson.com.  We don't reinvent the wheel... we just make reinventing the wheel easier. Visit PDFCalendar.com for free customizable printable calendars.
Home
Resources
Software
Links
Articles
About
About Drew
Contact
Feedback
Subscribe to our Newsletter:
Printer-Friendly
© 1999-2024
Andrew Davidson.
All Rights Reserved.

Where is PHP mt_seed()?

Copyright © 2006 Andrew B. Davidson. All Rights Reserved.
Last Updated: November 2006

Is there a corresponding mt_seed() function for mt_rand()?

Yes. However, you are probably thinking of the wrong name.
The name of the function you are after is mt_srand. It is defined as follows:
void mt_srand ( [int seed] )

Seeds the random number 
generator with seed. 

Since PHP 4.2.0, the seed becomes 
optional and defaults to a random 
value if omitted.
The mt_srand() function is available in PHP 3.0.6 or higher, PHP 4, and PHP 5, so you should have no trouble using this random seed function in your PHP scripts.
I hope this information helps the PHP development efforts for your web sites and scripts!

Comments?

If you have an comments or suggestions on this technique, you can email me at AndrewDavidson {at} AndrewDavidson {dot} com, or use my Feedback Form if you prefer.