1

http://viper-7.com/6soAKr

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

http://viper-7.com/6soAKr

1
  • Just change your first two 1's to 0 and that should fix it for you Commented Nov 27, 2015 at 18:57

1 Answer 1

1

You could keep the first for-loop (i.e. the one looping from 1 to 10) and instead of $sucid print 11-$scuid.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.