请教一个问题
如下代码excel.php,运行后显示导出excel。 现在我把该文件另存为保存为utf-8格式后,则再次运行后则无法正常显示。
我现在想在 另外一个程序中比如 test.php 引入该excel.php文件,因为 test.php 编码格式是utf-8的,另存为也是utf-8的,引入后就会显示不正确,提示Warning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\appserv\excel.php:1) in C:\AppServ\www\appserv\test.php on line 3
e请问如何解决,谢谢!<?php
header("Content-type:application/vnd.ms-excel");
header("Content-Disposition:filename=test.xls");
echo "test11\t";
echo "test12\t\n";
echo "test21\t";
echo "test22\t\n";
echo "test31\t";
echo "test32\t\n";
echo "test41\t";
echo "test42\t\n";
echo "test51\t";
echo "test52\t\n";
echo "test61\t";
echo "test62\t\n";
?>
如下代码excel.php,运行后显示导出excel。 现在我把该文件另存为保存为utf-8格式后,则再次运行后则无法正常显示。
我现在想在 另外一个程序中比如 test.php 引入该excel.php文件,因为 test.php 编码格式是utf-8的,另存为也是utf-8的,引入后就会显示不正确,提示Warning: Cannot modify header information - headers already sent by (output started at C:\AppServ\www\appserv\excel.php:1) in C:\AppServ\www\appserv\test.php on line 3
e请问如何解决,谢谢!<?php
header("Content-type:application/vnd.ms-excel");
header("Content-Disposition:filename=test.xls");
echo "test11\t";
echo "test12\t\n";
echo "test21\t";
echo "test22\t\n";
echo "test31\t";
echo "test32\t\n";
echo "test41\t";
echo "test42\t\n";
echo "test51\t";
echo "test52\t\n";
echo "test61\t";
echo "test62\t\n";
?>
弄在一起总是要打架的
上次问题远不止此。
但是这样问题又会来了,linux用户又会出现文件名乱码(因为linux平台文件名不是gbk编码)。http://www.phpnewer.com/index.php/Cjwt/detail/id/239