How to set variable and change its value in template

I am using for each loop in my template file. But I need some values from the last iteration.

So I want to store all these values into variables at the end of the current iteration and will use it in the next iteration.

So how can we do this in the Statamic template file?

Answered by Erin Dalzell!
>>>>>>> Answered <<<<<<<
1 Reply