Re: Loop within Loop help please
| From: | John Nichel | Date: | Tue, 28 Sep 2004 17:25:25 +0000 |
| Subject: | Re: Loop within Loop help please | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-198086@lists.php.net to get a copy of this message | ||
Nick Wilson wrote:
hi everyone, I have a simplified bit of code below: <?php foreach($someArray as $someVal) {$count = 0; foreach ( $someArray as $someVal ) { if ( is_int ( $count / 20 ) ) { // do this } // do this $count++; } -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 john@kegworks.com//do some stuff} ?> What i'd like to do is have a count inside that loop that will trigger some action every 20 iterations of the foreach. Like this: <?php $count=0; foreach($someArray as $someVal) {if($count is divisible by 20 exactly) { // do some stuff } //do some stuff} ?> How might i do that? Much thanks...