I am reading CSV file to PHP. File is reading properly except one thing. Issue is in reading words which are in non-English language.
Array is returning some symbols instead of other language exact word.
For eg: LBL_Hello Hello 你好
Above contents are there in CSV file. I am reading the words into PHP in form of Array using below code:
<?php
$file = file_get_contents("test.csv");
$data = (array_map("str_getcsv", preg_split('/\r*\n+|\r+/', $file)));
echo "<pre>";
print_r(($data));
exit;
?>
Output:
Array
(
[0] => Array
(
[0] => LBL_Hello
[1] => Hello
[2] => ���
)
[1] => Array
(
[0] =>
)
)
Here, Chinese word "你好" is showing as "���". This is happened with all other language words also.
Please help me to know what is missing so that I can get the exact other language word while reading CSV into PHP.
Thanks in Advance.