I have the problem with the php function fgetcsv() .
Lets start from the begin . I want to export csv files in ISO encoding and upload csv . With the export csv i dont have problem but with upload csv i have . This code runs perfect when i have not special characters . If i have greek characters he cannot read it and print NULL. If you can find me a solution !!!
Thanks for your time !!!
$csv = array(); $keys = array();
if (($handle = fopen($uploadedcsv, "r")) !== FALSE) {
while (($lines = fgetcsv($handle, 0, $delimiter)) !== FALSE) {
if ($row == 0) {
utf8_encode($keys);
utf8_encode($lines);
mb_convert_encoding($keys,'ISO-8859-15','utf-8');
mb_convert_encoding($lines,'ISO-8859-15','utf-8');
$keys = $lines;
} else {
utf8_encode($keys);
utf8_encode($lines);
mb_convert_encoding($keys,'ISO-8859-15','utf-8');
mb_convert_encoding($lines,'ISO-8859-15','utf-8');
$csv[] = array_combine($keys, $lines);
}
$row++;
}
fclose($handle);`