Re: Loop within Loop help please

From: Date: Tue, 28 Sep 2004 17:37:54 +0000
Subject: Re: Loop within Loop help please
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-198097@lists.php.net to get a copy of this message
* and then Jesse Castro declared.... > [snip] > <?php > $count=0; > foreach($someArray as $someVal) { > if($count is divisible by 20 exactly) { > // do some stuff > } > //do some stuff > } > ?> > [/snip] > > if($count is divisible by 20 exactly) > Can be written as > If ($count %20 == 0) > % is the modulus operator and works like the division > operator, only it returns the remainder instead of the > quotient. Ahhh.. thankyou very much jesse, that's great! -- Nick W

« previous php.general (#198097) next »