Commit 505a6480 by 朱继来

调整csv导出

parent 70918906
Showing with 2 additions and 2 deletions
...@@ -313,7 +313,7 @@ function export_csv($data = [], $header_data = [], $file_name = '') ...@@ -313,7 +313,7 @@ function export_csv($data = [], $header_data = [], $file_name = '')
$fp = fopen('php://output', 'a'); $fp = fopen('php://output', 'a');
if (!empty($header_data)) { if (!empty($header_data)) {
foreach ($header_data as $key => $value) { foreach ($header_data as $key => $value) {
$header_data[$key] = iconv('utf-8', 'gbk', $value); $header_data[$key] = iconv('utf-8', 'gbk//TRANSLIT//IGNORE', $value);
} }
fputcsv($fp, $header_data); fputcsv($fp, $header_data);
} }
...@@ -331,7 +331,7 @@ function export_csv($data = [], $header_data = [], $file_name = '') ...@@ -331,7 +331,7 @@ function export_csv($data = [], $header_data = [], $file_name = '')
} }
$row = $data[$i]; $row = $data[$i];
foreach ($row as $key => $value) { foreach ($row as $key => $value) {
$row[$key] = iconv('utf-8', 'gbk', $value); $row[$key] = iconv('utf-8', 'gbk//TRANSLIT//IGNORE', $value);
} }
fputcsv($fp, $row); fputcsv($fp, $row);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment