Page 1 of 1

Undefined Offset

Posted: Tue Oct 29, 2002 8:36 am
by bmerz
I am writing some code that takes indexes of an array and then places them on a website in a specific format, pretty simple, but when i try to access the array by using a variable index i get a notice that says

Undefined Offset: 43

i am not sure why this is because it works all the other times i try it in the code preceding it, just in two spots. Here is the code:

(comes at the end of a while loop after $i has been incremented)

Code: Select all

if ($thearrayї$i]ї'7'] != 'Systech')
{
	$is_sys = 0;
}
else if ($thearrayї$i]ї'7'] == 'Systech')
{
	$is_sys = 1;
}

$week_curr = $thearrayї$i]ї'0'];
Any ideas would be appreciated.

thanks,
brian;

Posted: Tue Oct 29, 2002 8:38 am
by twigletmac
$i has incremented up to 43 and there is no $thearray[43] element. To see exactly what is in $thearray (for debugging purposes) do:

Code: Select all

echo '<pre>';
print_r($thearray);
echo '</pre>';
Mac

fixed

Posted: Tue Oct 29, 2002 9:01 am
by bmerz
hey thanks, i just made a silly mistake that was no where that i was looking....just had to subtract the number of times i was running the loop by one.

thanks for the help,
brian;