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

split string
Hi all

i have some names (imploded by comma):
Code: toronto,paris,madrid
Now, i would

Combining Two Queries
I have two scripts that each work fine by themselves. One is a search script with a variable that de

timed header image rotation
I have a joomla site and I was trying to setup a rotating image based on timing NOT just refreshing

parsing error
can anyone explain this syntax error:

Parse error: syntax error, unexpected T_IF

The e

php redirecting
i wont open a new thread but i have a question about redirecting....
i wonder why my code doesnt

Add "width" check when upload
Hi!

Can someone add a function that is checking if picture witdh is bigger then 800px whwn up

Check before inserting in DB ???
This is my code
---------------
if ( $_POST ['Submit'])
{{
$username = $_POST ['usernm

values in array being escaped
I would like to submit some values - back to the same form for checking before processing...

upload image name with extension using php
hi frds..

<input id="file1" type="file" name="file[]" &a

Session is not saving
I am not trying to do anything too fancy, I am just trying to get some $_SESSION data to save and us

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