In case anyone cares....
I added:
PHP Code:
$fd = fopen ("data.csv", "r");
// loop until EOF
while (!feof ($fd)) {
// read one line, up to 4KB
$buffer = fgets($fd, 4096);
if ($buffer == '') exit(); // 2 single quotes
else {
// explode to get each field from line
$data = explode(";", $buffer);
$data = str_replace("\"", '', $data);
// do some stuff to enter fields into DB
}
}
fclose ($fd);
To stop it outputting garbage if there are empty lines at the end of the file. (in my case empty lines will not occur in the file up till then).