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;
Did you know?Explore Trending and Topic pages for more stories like this.
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

Header is not working in IE
Hi ! header function is not working in IE but it works in FF, Safari, Chrome. any help please. :

word wrap in emails help needed
Hello, I understand how wordwrap works in php and have used it well before. However when I used wor

Help building / using array
First - this is a cross-posting, if this is wrong I apologise! What started out as a MySQL query que

FFmpeg Images 2 Video conversion problem ??
I got folder full of images , number of images = 600 , I want to make a video which plays one image

Form File Upload
I've read through tons of resources and tutorials and as far as I can tell, my code is accurate, but

Detail Expenses Report by Cost Center
I would like to obtain a report out of SAP that shows a list of expenses by cost center that shows t

php sessions,logouts & the bloomin back button!
Hi All,

I've got a cms that members can log into. When they logout, the session is destroyed,

Problem!
I have another problem, when i run this code i get this error "Parse error: syntax error, unexp

Showing selected item at top of list
Hi,

I've got a list of names which i am fetching from database like this:
$qry = db_query

Is STL important?
I'm just starting programming and I've made it until the Standart Template Library. But the chapter

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