Php importing google contacts csv file

After reading the csv file, I get question marks in the answer. check the image below for more reference.

enter image description here

I am trying to import google contacts into my web application. This is my code

$csvAsArray = array_map('str_getcsv', file($tmpName));
        foreach($csvAsArray as $arr){
            var_dump($arr);
        }

      

where $ tmpName is the location of the file. Any help would be appreciated.

+3


source to share


1 answer


Using iconv ('UTF-16', 'UTF-8', $ fileContent) on my CSV server solved the problem for me.



0


source







All Articles