I initially posted this query, but haven't yet figured the exact issue out. I do, however, have a bit more understanding of what is going on, so I will plead my case over.
Here's the chunk of script:
83 require ("$reportfile");
84
85 // First find the maximum value of $p,
86 // and count the rows.
87 $cnt="0";
88 $s = "0";
89 $fp=fopen($reportfile,'r');
90 while ( !feof($fp) ) {
91 list($d,$p,$count)=split("\t",fgets($fp,1000));
92 if ($p > $s) { $s = $p; }
93 $cnt += 1;
94 }
95 rewind($fp);
The issue is at line 91 - I get the following undefined offset:
PHP Notice: Undefined offset: 2 in /home/dshield/bin/tinyplot.php on line 91
PHP Notice: Undefined offset: 1 in /home/dshield/bin/tinyplot.php on line 91
The contents of the file, $reportfile, is this:
2004-11-17 48.66 4867
2004-11-14 24.12 62
Column 1 is a date, obviously;
Column 2 is a percentage and
Colum 3 is a count.
It looks like line 91 is going to split each line into three elements, $d, $p, $count, delimited by a tab. All three columns have a value.
So, what is the undefined offset? I thought I was starting to understand it, but now I'm not sure. Since all three columns have a value, I don't know what to look at.
Thanks,
monger