sugan Posted January 26, 2008 Share Posted January 26, 2008 Hi,I have an array which contains numbers, and i want a number to be picked randomly from the array each time i load the page without using random function.Is it possible to generate a random number without using rand() function. If so pls tell the code.Regards,Sugan Link to comment Share on other sites More sharing options...
jhecht Posted January 26, 2008 Share Posted January 26, 2008 ... no... you can set limits to the random function, you kno that right? Link to comment Share on other sites More sharing options...
boen_robot Posted January 26, 2008 Share Posted January 26, 2008 Check out array_rand(). Link to comment Share on other sites More sharing options...
sugan Posted January 26, 2008 Author Share Posted January 26, 2008 Thanks, but i want the code without any functions.Regards,Sugan Link to comment Share on other sites More sharing options...
boen_robot Posted January 26, 2008 Share Posted January 26, 2008 Thanks, but i want the code without any functions.Regards,SuganYou're joking, right? That's impossible. Why would you want it not to be a function anyway? Performance considerations? I'm afraid you're going to have to accept it and further improve performance on other parts of your script. Link to comment Share on other sites More sharing options...
Synook Posted January 27, 2008 Share Posted January 27, 2008 I challenge you to show me a piece of useful code without any functions methods are counted as functions. Go! Link to comment Share on other sites More sharing options...
justsomeguy Posted January 28, 2008 Share Posted January 28, 2008 Is it possible to generate a random number without using rand() function.Thanks, but i want the code without any functions.OK, then write your own random number generator. Good luck with that. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.