convert csv file to csv UTF8 by php -
i got .csv file client when read php, show text can't read. try upload , open google sheet , export .csv again google. work perfect when read php.
are there way convert .csv .csv utf8 without using google ? because client send .csv server everyday automatic. , php script read , import .csv data database. please help
thanks
i found way, first using
header('content-type: text/html; charset=utf-8'); , need find encode language use here
http://destructor.de/charsets/index.htm
my language thai need use windows-874. should be: iconv( "windows-874", "utf-8", $data[$c] )
so using 2 line
header('content-type: text/html; charset=utf-8'); iconv( "windows-874", "utf-8", $data[$c] )
thank sumit :)
Comments
Post a Comment