Reputation: 97
I'm trying to display a list of items in groups of 4. If I go from 1-10 in the for loop, it works great and I get the following output:
1 2 3 4
5 6 7 8
9 10
I'm using this code: http://viper-7.com/6soAKr
I actually need to display them in reverse order from 10-1 in the same format
When I try the code in reverse order:
($sucid = 10; $sucid > 0; $sucid = $sucid - 1)
I get:
10 9 8
7 6 5 4
3 2 1
And the HTML layout is out of place compares to the output of the top
What I need is:
10 9 8 7
6 5 4 3
2 1
I know it's the modulus part that is wrong, but I am having trouble understanding how to change it when I go backwards
Upvotes: 1
Views: 61
Reputation: 96159
You could keep the first for-loop (i.e. the one looping from 1 to 10) and instead of $sucid
print 11-$scuid
.
Upvotes: 1