add the following:
if( $i % 3 == 0 ) {
print("something else");
}
You might need to vary the zero in that equation to get it to print at the
"right time" by which I mean, the above will print "something else" on the
first iteration of the below loop.
-philip
On Wed, 4 Sep 2002, Cirkit Braker wrote:
> what would be the best, most efficient way to print something every three
> times a loop runs
>
> for ($i=0; $i<$num_products; $i++)
> {
> echo "something";
> }
>
> this happens every time it runs and has to stay that way but every three
> times i want to print additional info.
>
> Any help appreciated.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php