the strange thing is that i'm getting 9 errors and the array has 10 values...
Undefined offset: 2 in C:\wamp\www\Conquer\newengine.php on line 758
thats the same for Undefined offset: 2-10
here's the part of the script
Code: Select all
for($i=1;$i<=10;$i++)
{
$taraname='u1'.$i.'name';
$surv1[$i]=$$taraname?$unitarray1[$$taraname][1]:false;
$taraname='u2'.$i.'name';
$surv2[$i]=$$taraname?$unitarray2[$$taraname][1]:false;
//////////////////////// LOSSES
$taraname='u1'.$i.'name';
$lost1[$i]=$$taraname?$u1firstqty[$i]-$surv1[$i]:false; /// L 758
if($lost1[$i]<0)
{$lost1[$i]=0;}
$taraname='u2'.$i.'name';
$lost2[$i]=$$taraname?$u2firstqty[$i]-$surv2[$i]:false;
if($lost2[$i]<0)
{$lost2[$i]=0;}
}// for(10)
Code: Select all
print_r($lost1); Code: Select all
Array ( [1] => 0 [2] => 0 [3] => 0 [4] => 0 [5] => 0 [6] => 0 [7] => 0 [8] => 0 [9] => 0 [10] => 0 )Code: Select all
Array ([1] => 13 [2] => 0 [3] => 0 [4] => 0 [5] => 0 [6] => 0 [7] => 0 [8] => 0 [9] => 0 [10] => 0 )