jigen7 Posted September 22, 2007 Share Posted September 22, 2007 can anyone hep me me make a function that return random numbers but it will not generate another random number if he already pass the value for example it return 2, so after i call the function random again it will not return another 2 i want another numbers to be returned instead ?? can anyone help me here? function random($max){ srand ((double) microtime( )*1000000); $random_number = rand(0,$max); return $random_number; } Quote Link to comment Share on other sites More sharing options...
Jessica Posted September 22, 2007 Share Posted September 22, 2007 you could make an array of numbers using range, and then shuffle it and unset it one by one. Quote Link to comment Share on other sites More sharing options...
jigen7 Posted September 22, 2007 Author Share Posted September 22, 2007 that will do thx jessie?? any other idea? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.