I am storing one CSV file values into another through PHP.
I want to save $col_1_values_array
values in one column into CSV file and $col_2_values_array
into another column. although my code is showing all values into a single row,how can i correct it?
here's my code
$data_file = $ride[$i][0];
$file_delimiter = ',';
$csv = new csvCRUD($data_file,$file_delimiter);
$col_1_values_array=$csv->output_column('C','array');
$col_2_values_array=$csv->output_column('D','array');
$c=count($col_1_values_array);
$line=array();
$fp = fopen('7654.csv', 'w');
for($p=0;$p<$c;$p++)
{
$line[]=$col_1_values_array[$p];
$line[]=$col_2_values_array[$p];
}
fputcsv($fp,$line);
fclose($fp);