I want to write a hundred records continously in different files named with time()
.
This code works well but writes only 1 record to each file. How can I do this?
$i=0;
$file= time();
foreach ($dizi as $fields) {
$i++;
if($i%100==0){
$fp = fopen($file.'.csv', 'w');
}
fputcsv($fp, $fields,';','"');
fclose($fp);
}