I use the background style warning system "PHP" for my website, which basically says "if there is an X percent change between the current array entry and the next, print an error."
So, I iterate over the elements of the array in the foreach loop, but should be able to do something like this: (note: this is just a basic example, but this should be enough to get the idea)
foreach($array as $a)
{
$thisValue = $a['value'];
$nextValue = next($a['value']);
$percentageDiff = ($nextValue-$thisValue)/$thisValue;
}
I added next () tags to get the next value, but I understand that this only works for arrays. Is there anything else I can use to get the next foreach element?
Thank you for your time!
Sk446