Richard Wilson - 2005-10-03 02:30:43
I exported my phone list from Outlook in CSV format.
With CSVHandler, I got undefined index errors on line 37. I investigated and found that fgetcsv did not get the right number of columns. To fix this, I changed the following code:
while ($DataLine = fgetcsv ($fp, 3000, $this->Separator)) {
for($i=0;$i<count($this->HeaderData);$i++){
$Item[$this->HeaderData[$i]]=$DataLine[$i];
to:
while ($DataLine = fgetcsv ($fp, 0, $this->Separator)) {
for($i=0;$i<count($this->HeaderData);$i++){
if ($i < count($DataLine))
{
$Item[$this->HeaderData[$i]]=$DataLine[$i];
} else
$Item[$this->HeaderData[$i]]='';
It seems to work now.