Perad Posted January 25, 2008 Share Posted January 25, 2008 The question I posed above. How do I do it? Quote Link to comment https://forums.phpfreaks.com/topic/87810-solved-how-can-i-check-is-a-number-is-divisible-by-3/ Share on other sites More sharing options...
PHP Monkeh Posted January 25, 2008 Share Posted January 25, 2008 Everything is divisible by 3. But I'm going to assume you mean does it have a remainder once it's divided by 3, which is done using % <?php $number = 6; if(($number % 3) == 0) { // There was no remainder } ?> Quote Link to comment https://forums.phpfreaks.com/topic/87810-solved-how-can-i-check-is-a-number-is-divisible-by-3/#findComment-449160 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.