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. 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"; } 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 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
Archived
This topic is now archived and is closed to further replies.