I would like to tell if a number can be divided into 7 evenly, and if true exicute the code.
$number = 7;
or
$number = 14;
or
$number = 21;
and so on...
if($number / 7) ? but always returns true
How to tell if number fits evenly?
Moderator: General Moderators
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Code: Select all
if ($number % 7 == 0)
{
//stuff here
}