Im trying to add data to a csv file, however every time i run the php script it will add the data two or three times and that is of course super annoying! Just wondering if anyone has an idea of why this is happening? PHP Code:
$my_file2 = 'TEMP/temp.csv';
$handle = fopen($my_file2, 'a');
$data = "Mobile,".$mobi.",Message,".$message."\n";
fwrite($handle, $data);
fclose($my_file2);

fopenmode asaso it will append data every time, not overwrite. php.net/manual/en/function.fopen.php