Re: [PHP] Calculating if number is multiple of another number

2003-07-02 Thread Leif K-Brooks
jwulff wrote: How would I calculate if a $number is a multiple of $spacer? if(int($number / $spacer) == ($number / $spacer)){ echo "It's a multiple!"; }else{ echo "Nope!"; } -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosec

Re: [PHP] Calculating if number is multiple of another number

2003-07-02 Thread Jason Sheets
Using the modulus operator it returns the remainder of a division operator. For example to find out if a number is divisible by 3 do this: if (($number % 3) == 0) { print $number . ' is divisible by 3'; } else { print $number . ' is not divisible by 3'; } If the remainder of dividing the ta

RE: [PHP] Calculating if number is multiple of another number

2003-07-02 Thread Martin Towell
($spacer % $number == 0) Martin -Original Message- From: jwulff [mailto:[EMAIL PROTECTED] Sent: Thursday, 3 July 2003 11:04 AM To: [EMAIL PROTECTED] Subject: [PHP] Calculating if number is multiple of another number How would I calculate if a $number is a multiple of $spacer? -- PHP G