How to compare prior values in a section loop
How can I read the previous value in a loop?
For example I have
Copy to clipboard
{ section name="foo" loop="$somecounter"} . . . { /section}
But in the section loop, I want check the current value of an array item against the previous. I tried this:
Copy to clipboard
{ section name="foo" loop="$someCounter"} . { if $variable[someCounter] = $variable[someCounter - 1] then do this { else} do this { /if} . . { /section}
But adding the -1 seems to break the php. Can anyone help?
Thanks,
-Rick