문제

writes to me :

Message: Undefined offset: 1
Message: Undefined offset: 2
Message: Undefined offset: 3
Message: Undefined offset: 4

in Line Number: 93

my script:

$day = 1;
for($i = 0; $day <= $this->datum->format('t'); $i++ )
{  
   for($j = count($table[$i]); $j < 7 && $day <= $this->datum->format('t'); $j++)
   {
      $table[$i][$j] = $day++;
   }
}

line 93:
for($j = count($table[$i]); $j < 7 && $day <= $this->datum->format('t'); $j++)

I read the discussion but nothing that would solve my problem. Thank you in advance and sorry for my bad English.

도움이 되었습니까?

해결책

Since in the referred line you only index the $table array, the error output means that the $table array does not have an element indexed by 1, 2, 3 or 4.

Without further information about your code, it is unclear why those elements do not exist. I suggest you to output the content of the $table array for debug purposes and compare it with the data that should be there.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top