xkyogre Posted June 26, 2007 Share Posted June 26, 2007 In php is there a predefined function to creat random numbers between x and y If not, how do you create one? Link to comment https://forums.phpfreaks.com/topic/57270-creating-randomised-numbers/ Share on other sites More sharing options...
trq Posted June 26, 2007 Share Posted June 26, 2007 rand(). Link to comment https://forums.phpfreaks.com/topic/57270-creating-randomised-numbers/#findComment-283079 Share on other sites More sharing options...
xkyogre Posted June 26, 2007 Author Share Posted June 26, 2007 Thank you but how do you get to select the range of numbers Link to comment https://forums.phpfreaks.com/topic/57270-creating-randomised-numbers/#findComment-283090 Share on other sites More sharing options...
chocopi Posted June 26, 2007 Share Posted June 26, 2007 rand(x,y) Link to comment https://forums.phpfreaks.com/topic/57270-creating-randomised-numbers/#findComment-283093 Share on other sites More sharing options...
marcus Posted June 26, 2007 Share Posted June 26, 2007 $rand = rand(1,5); //from 1-5 $x = 10; $y = 13000; $rand = rand($x,$y); //from 10 to 13,000 Link to comment https://forums.phpfreaks.com/topic/57270-creating-randomised-numbers/#findComment-283094 Share on other sites More sharing options...
trq Posted June 26, 2007 Share Posted June 26, 2007 how do you get to select the range of numbers Did you read the link I posted? Link to comment https://forums.phpfreaks.com/topic/57270-creating-randomised-numbers/#findComment-283097 Share on other sites More sharing options...
xkyogre Posted June 26, 2007 Author Share Posted June 26, 2007 Yes thank you. You have all solved my query. Link to comment https://forums.phpfreaks.com/topic/57270-creating-randomised-numbers/#findComment-283308 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.