I am try to read a csv file which has 200000 records, and then using loop to insert the record which is quite very slow.
So I want to read the file by 10k. Like first read 1 to 10k and in second time read 10k to 20k and so on.
I have done the following
$row1 = fgetcsv($handle, $delimiter);
$endNumber = 8635;
for ($i = $start; $i < $endNumber; $i++) {
fgets($handle);
}
It is used to skip the record but it is not working as i need and also used this
for($i = 8; $row = fgetcsv($handle, $delimiter); $i++) {
if($i === $endNumber) {
fclose($handle);
return $rowy;
}
}