Today's PHP tip: rand() seed
Before using the rand() function, it's a good idea to seed the random number generator first.
This can be done with the srand() function. Its most common form is:
srand((double)microtime() * 1000000);
If you don't take this step before using rand(), it's possible - likely, even - that your "random" numbers will not necessarily be random.
Looking for quality PHP scripts at a price that won't break the bank?
Check out
PHP Labs for professional scripts and thousands of webmaster resources.