Sorry for my english) I have a problem! I read file with extension .csv but each line returns string, like this
JavaScript
x
36794;"""Белоснежка""";"9785783314353";"Белоснежка";0;0;""
36795;"""Гуси-лебеди""";"9785783320361";"Гуси-лебеди";1;0;""
I can’t convert these strings to array. This is my code.
JavaScript
if (($handle = fopen($local_file, "r")) !== FALSE) {
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
$num = count($data);
$row++;
for ($c=0; $c < $num; $c++) {
echo $data[$c] . "<br />n";
}
}
fclose($handle);
}
Thank you for your help)))
Advertisement
Answer
You ask no question actually…
But the CSV is quoted properly, at least if the double quotes ought to be correct in the columns B and D.
edit: You’re using the wrong delimiter. The file contains semicolon, while you specify colon.