Why i will not use Fgetcsv

I usually use Fgetcsv to import data with a csv.
But on some imports i have caps characters with accents.
So if i have this line in CSV :

Édouard;Georges;2007-01-02

The fgetcsv code will output:

Array ( [0] => douard [1] => Georges [2] => 2007-01-02 )

To have the first character, we just have to use fget with an explode on the separator character !


$handle = fopen(”file.csv”, “r”);
while (!feof($handle)) {
$data = explode(”;”,fgets($handle));

}
fclose($handle);


About this entry