$days = <whatever>;

if ($days % 7 == 0) {
  ...then $days is divisible by seven;
} else {
  ...if is not;
}

the % is the modulus operator. basically divides left hand side by right
hand side and returns the remainder.

HTH

On Fri, 27 Apr 2001, Jacky wrote:

> ----- Original Message -----
> From: Jacky
> To: [EMAIL PROTECTED]
> Sent: Friday, April 27, 2001 2:59 PM
> Subject: how do I calculate this?
>
>
> Hi all I have a variable that store number of days, I want to divided
> by 7 and if it can be divided by 7 perfectly, then I will redirect
> them to one page, otherwise send them to another page. How do I set up
> condition in the if...then....else bit to determine if the value is
> divided by 7 perfectly or not? cheers Jack [EMAIL PROTECTED]
> "There is nothing more rewarding than reaching the goal you set for
> yourself"
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to