Fog Juice Posted June 26, 2009 Share Posted June 26, 2009 Is there a way to use the mod function so that it only returns 1 when ever a variable is on an increment of 10? So for example if a variable has reached 10, 20, 30, 100, 200, 1000 etc, is there a way to use mod to have it either return 1 if it is or 0 if it is not? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/163792-solved-finding-when-a-number-is-on-102030-100-etc/ Share on other sites More sharing options...
rhodesa Posted June 26, 2009 Share Posted June 26, 2009 if(!($num%10)){ print "Multiple of 10"; } Quote Link to comment https://forums.phpfreaks.com/topic/163792-solved-finding-when-a-number-is-on-102030-100-etc/#findComment-864233 Share on other sites More sharing options...
Fog Juice Posted June 26, 2009 Author Share Posted June 26, 2009 thanks Quote Link to comment https://forums.phpfreaks.com/topic/163792-solved-finding-when-a-number-is-on-102030-100-etc/#findComment-864239 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.