I have the following PHP script which reads from two CSV files, At the moment I am putting the data into a table however I need it to output to a CSV file...
<?php
$products_file = fopen('Products.csv', 'r');
$manufacturers_file = fopen('Manufacturers.csv', 'r');
$manufacturers = array();
while (($manufacturers_line = fgetcsv($manufacturers_file)) !== FALSE) {
$manufacturers[$manufacturers_line[0]] = $manufacturers_line [1];
}
echo '<table><tr><th>SKU</th><th>Make and Model</th><th>Make and Model</th></tr>';
while (($products_line = fgetcsv($products_file)) !== FALSE ) {
echo '<tr><td>'.$products_line[3].'</td><td>';
echo $manufacturers[$products_line[5]];
echo '</td><td>'.$products_line[4].'</td></tr>';
}
echo '</table>';
fclose($products_file);
fclose($manufacturers_file);
?>
How can I do this using fputcsv ?