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

need help with date function
i have following form for date

Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01

Optimize Code
Just started getting into the use of cookies. The following code will redirect users to a set URL s

Count Session and Trigger Events
I am New in PHP, seeking a method to count logged users by counting the sessions or any …, is

Check premium expire
Hi,

I am making a simple file hosting site and want to check if users premium subscriptions h

Generate PDF
Hi guys,

I would like to know if there is a way to generate pdf when clicking on a link. In f

defining website tags
Hi,

What would be the best way to define tags for my site, such as website title, url etc.

FAGL_FC_TRANSLATION FAS52 New GL ECC 6.0
Hello,

The new program for Translating GL Balances (FAS 52) gives the option to use diffe

Need help in log in and log out?
hi there all of u. i have recently created a site for someone. i have placed log in and log out and

How to use Substr
I want to check for the word CATEGORY: inside a string which can be CATEGORY: ITEM
and remove the

bind error during socket programming
i am kinda new to socket programming. wrote the below code for a server. but getting the bind error

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