PDA

View Full Version : is divisible by....


Jolten
11-07-2005, 07:19 PM
How can I code a line and use a function like "is divisible by"?

Something like this:



if ($a -is divisible by- 4) {

blah

} else {

Blah Blah

}


thanks

noppid
11-07-2005, 07:27 PM
if(!($a%4))
{
// do stuff
}


http://www.w3schools.com/php/php_operators.asp

Jolten
11-07-2005, 07:30 PM
Thank you!

So I understand... basically it's if $a is NOT a multiple of 4 then.... Is that correct? Just want to understand the underlying code.