Re: Fw: how do I calculate this?

From: Date: Fri, 27 Apr 2001 11:32:25 +0000
Subject: Re: Fw: how do I calculate this?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-50589@lists.php.net to get a copy of this message
$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: php-general@lists.php.net > 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 jacky@activelifestyle.com > "There is nothing more rewarding than reaching the goal you set for > yourself" >

« previous php.general (#50589) next »