Canman2005 Posted August 30, 2009 Share Posted August 30, 2009 Hi all I am doing $rand = rand(1,655); how can I do that but make sure it excludes number 300 thanks Link to comment https://forums.phpfreaks.com/topic/172498-solved-doing-rand-excluding-a-number/ Share on other sites More sharing options...
RussellReal Posted August 30, 2009 Share Posted August 30, 2009 while (($rand = rand(1,655)) == 300) { // do nothing.. } // $rand will never equal 300.. lol Link to comment https://forums.phpfreaks.com/topic/172498-solved-doing-rand-excluding-a-number/#findComment-909388 Share on other sites More sharing options...
Canman2005 Posted August 30, 2009 Author Share Posted August 30, 2009 thanks Link to comment https://forums.phpfreaks.com/topic/172498-solved-doing-rand-excluding-a-number/#findComment-909390 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.