Guys,
I have a 3 dimensional array that I am processing below. Unfortunately the server will not forget the value of the 2 dimensional array when I go back and forth between pages. The goal of the statement below is to sum all of the $i dimension of the 3 dimensional array $bar into the 2nd dimension of the $foo array. The loop works as expected the first time through and displays correctly on the next page. The issues is when the user goes back and forth.
line 1 for ($j = 0 ; $j < $z ; $j++){
line 2 for ($k = 0 ; $k <= $y; $k++){
line 3 for ($i = 0 ; $i < $x; $i++){
line 4 $foo[$j][$k] = $bar[$j][$k][$i] + $foo[$j][$k];};};}
I have thought of 2 solutions.
1. I unset($foo); before the loop, and theortically the array $foo is empty and should be processed cleanly. That is not happening! I even tried to unset(_$SESSION'$foo'); and no luck!
- There is a better way to sum the $i dimension of that array. I think my main problem is that the previous value of $foo[$j][$k] is still in memory and gets added into line 4 during the 1st loop back through the array.
There must be a ton of ways to skin this cat! Please help! Gracias, Happy 6th de Mai!