this post basically consists of 2 questions. hope you can help me! 1)is there any way to specify the number of digits of a random number generated and how? 2)i currently use the following method to generate random numbers: mt_srand((double)microtime()*1000000); $randomnum = mt_rand(); is this the best way or is there better?
thanks!!
Hi Dan, The way you did is right.You can,t specify the number of digits directly instead you can do this, suppose you wish to generate 4 digit random numbers specify the limits i.e $randomnum = mt_rand(1000,9999);