How can I remove the quotation marks from the new CSV file?
The issue of quotation marks in a CSV file can be solved by using the `fgetcsv()` function in PHP. This function reads a line from an open file and parses it according to CSV rules. By using this function, we can read the CSV file without the quotation marks and then rewrite it to a new file without the unwanted characters.
$inputFile = 'input.csv';
$outputFile = 'output.csv';
$inputHandle = fopen($inputFile, 'r');
$outputHandle = fopen($outputFile, 'w');
while (($data = fgetcsv($inputHandle)) !== false) {
fputcsv($outputHandle, $data);
}
fclose($inputHandle);
fclose($outputHandle);
Related questions
-
variable variables dynamic naming PHP
-
InnoDB MyISAM autoincrement
-
CSS attributes hide