Hello there:
function Calc($DDX, $II) {
global $DDX, $II;
print_r($DDX); // DDX[1][1][1]=12.34, DDX[2][1][1]=9.6435, …
$J=1;
$K=1;
$ALL=0;
for ($I=1; $I<=$II; $I++) {
100: $ALL=$ALL+$DDX[$I][$J][$K];
}
}
when I run this function, I get “Undefined index: 1 in line 100”. However, by changing $DDX[$I][$J][$K] to for exapmle $DDX[3][1][1], I can get a new value for $ALL.
Would you please let me know why I do get error “Undefined index: 1 in line 100”?