php导出excel,使用office打开乱码解决
作者:
简单的破小孩儿 | 来源:发表于
2018-07-18 16:45 被阅读0次header("Content-type:application/vnd.ms-excel;");
header("Content-Disposition:attachment;filename=".$fileName.".xls");
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
header('Content-Transfer-Encoding: binary');
header('Cache-Control: must-revalidate');
array_unshift($list, $header);
foreach ($list as $key1 => $row) {
foreach ($row as $key2 => $cell) {
$list[$key1][$key2] = sprintf('<td>%s</td>', $cell);
}
}
$table = '';
foreach ($list as $key1 => $row) {
$table .= sprintf('<tr>%s</tr>', implode('', $row));
}
echo '<table border=1>'.$table.'</table>';
exit;
本文标题:php导出excel,使用office打开乱码解决
本文链接:https://www.haomeiwen.com/subject/umxapftx.html
网友评论