I have 2 csv documents. I have a code that counts how many rows don't exist in the old csv that are in the new.
My task is to create a new csv and put those rows in it.
What command or function can I use to do it with PHP?
I have 2 csv documents. I have a code that counts how many rows don't exist in the old csv that are in the new.
My task is to create a new csv and put those rows in it.
What command or function can I use to do it with PHP?
user3215319 got it close...
$myarray = array(
array('one', 'two', 'three', 'four'),
array('red', 'yellow', 'green', 'brown'),
array(1, 2, 3, 4),
);
$mycsv = fopen('myfile.csv', 'w');
foreach ($myarray as $row) {
fputcsv($mycsv, $row);
}
fclose($mycsv);