In article <da**************************@posting.google.com >,
lk******@geocities.com (lawrence) wrote:
I just switched error_reporting to ALL so I could debug my site. I got
a huge page full of errors. One of the most common was that in my
arrays I'm using undefined offsets and indexes. These still work fine,
but with error reporting at all they are marked as errors. Why? What
am I doing wrong?
It means you're referring to an array key that doesn't exist. "Offset"
refers to the integer key of a numeric array, and "index" refers to the
string key of an associative array.
$s_arr=array("apple", "banana");
print $s_arr[2]; //undefined offset
$a_arr=array("fruit"=>"apple", "meat"=>"beef");
print $a_arr['produce']; //undefined index
--
CC