Hello,
I have a problem with this code:
$r1 = "1;2;3";
$r2 = "4;5;6";
$r3 = "7;8;9";
$r = $r1 . PHP_EOL . $r2 . PHP_EOL . $r3 . PHP_EOL;
$nomeFile = 'test.csv';
$file = fopen($nomeFile, 'a') or die ('Error' . $nomeFile);
fwrite($file, $r) or die ('Error' . $nomeFile);
fclose($file);
Using Safari browser on Mac OS X, when I load the page, in the file created rows are duplicated.
If you reload the page without closing the browser tab the script works well, adding three lines to the file.
Where am I wrong?