Hi guys,
I'm using fgetcsv() to read and process a CSV file. I get no errors, but it seems that for certain data PHP saves 2 or 3 CSV cells into a single array cell!!!! so I get line[12] for example as NULL!
Any idea? could that be caused by double-quotes or long numbers?? Not sure
Thanks
My code
I'm using fgetcsv() to read and process a CSV file. I get no errors, but it seems that for certain data PHP saves 2 or 3 CSV cells into a single array cell!!!! so I get line[12] for example as NULL!
Any idea? could that be caused by double-quotes or long numbers?? Not sure
Thanks
My code
Code:
<?php require('config.php'); ?>
<?php
$csvfile = fopen($dataPath, "r");
while (!feof($csvfile)){
$line = fgetcsv($csvfile, 1024, ',');
$active = $line[0];
$title = $line[1];
$image = $line[2];
$man = $line[3];
$descriptions = $line[4];
$descriptionl = $line[5];
// etc...............
$cost = $line[20];
echo $man . "<br />";
}
fclose($csvfile);
?>






