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
You’re currently reading “Why i will not use Fgetcsv,” an entry on Make me pulse - Making a better life for web developer since 2006
- Published:
- 07.18.07 / 11am
- Category:
- Php


2 Comments
Jump to comment form | comments rss [?] | trackback uri [?]