SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
Thread: skipping indexes in arrray loops
Threaded View
-
May 7, 2009, 06:32 #1
- Join Date
- Oct 2008
- Location
- England
- Posts
- 80
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
skipping indexes in arrray loops
Hi i want to loop through an setup array skipping an index at a time
e.g. 1,2,3,4
but looping 1,3,5,7 but the catch is when looping i want to display 2,4,6,8.
for example
$array = array("1", "top admin", "2", "middle admin", "3", "mod").
foreach array = $value+2
{
echo "$value . "is number " . array(i+1);
}
sorry if this is quick but doing it on borrowed time. any ideas?
Bookmarks