Question

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.

Était-ce utile?

La solution

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top