Do something every fifth time?


Posted on 16th Feb 2014 07:03 pm by admin

I'm trying to write a loop, but I want it to do something different after every fifth instance. Like, I want it do something like this:

Quoteecho $a1;
echo $a2;
echo $a3;
echo $a4;
echo $a5.$b;
echo $a6;
And so on.. any idea on how to do this?

No comments posted yet

Your Answer:

Login to answer
257 Like 33 Dislike
Previous forums Next forums
Other forums

passing an array of objects after submit
How do I do this? This is what I have tried and it is not working.

<form method="

Why will this program not run if the variables are not global?
Hey guys I have a kind of perplexing situation that is probably simple, but I can't seem to understa

Save User Inputs while javascript reloading!
hi..
i have written a PHP code in which i reload the page when user selects a value in dropdown..

Run function every 5 mins ??
I have a function PostMessage()

How can I run it every 5 mins ??

PHP4 to PHP5 Conversion
Hi Everyone,

I am working on a site that is built up on PHP4 and each page is being started f

Form always sends to error page...
Hello,
Any help will be greatly appreciated. I am having trouble getting multiple fields to be re

Month String to Numeric?
Hi guys,

Given a month as a string, is there a simple way to find the numeric representation

Unable to retreve the values from Mysql Query
Hi,

Here is the php code that I have, Query is running properly in phpmyadmin and is resu

Auto install
Hi I have a directory lets say "apps" that I then have more folders ie "email",

foreach help.
Hello all,

First time I'm attempting to use a foreach statement and was just wondering if my

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash