Answer the question
In order to leave comments, you need to log in
How to write csv to 1 column?
I have a CSV file with multiple columns. I need to take data from it in one column and write it to a new csv file. The fputcsv() function takes an array. And how to write only lines?
$fp = fopen('content.csv', 'r');
$newCsv = fopen('new_content.csv', 'w');
while($data = fgetcsv($fp,0,';'))
{
fputcsv($newCsv, $data[15], ';');
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question