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 Quote 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 Quote 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 Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.