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

PHP error on MySQL insert
I'm sure it's the simplest of issues, but I can't recall why this isn't working.

Code: [Selec

first few characters only
hi, does anyone know how to use PHP to take the first few words of a text and limit them? i have see

Looking for help reading a .txt or .ini file and outputting the info.
I have a file called Info.ini and It has the following info:
Code: [General]
Online=0
I wou

why aint this working?
i have this code:

Code: $num = 250;
$count = ($num - $rcount);

echo $rc

Sending an SMS Message with ASP.NET
Often times it may be a requirement for your web application to send an SMS message. Such examples w

Using two $_POST Function / Switch () statements, second does not work.
Hi all. I’m new to php and am having a problem getting $_POST Function / switch () to work. I

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

check comment for html
hi, I just wanted to check if a comment a user posts contains HTML, and if it does, to not allow it

Connect to database that isn't localhost
I am currently doing a small script for a company that doesn't have mySql support on there hosting.

To change the name of label on SAP screen XK02.
Hi All,

Can one suggest me how to change the label of an input field of a sap standard s

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