PHP生成EXCEL表格的问题
我参照了下面一段代码从PHP中生成EXCEL:
<?
header("Content-type:application/vnd.ms-excel");
header("Content-Disposition:filename=test.xls");
echo "test1\t";
echo "test2\t\n";
echo "test1\t";
echo "test2\t\n";
echo "test1\t";
echo "test2\t\n";
echo "test1\t";
echo "test2\t\n";
echo "test1\t";
echo "test2\t\n";
echo "test1\t";
echo "test2\t\n";
?>
但在调用数据库时,原先的换行符在EXCEL表格中不支持,所以EXCEL表乱了……
求EXCEL表格格式控制的代码,或者求高手给预指点!
<?
header("Content-type:application/vnd.ms-excel");
header("Content-Disposition:filename=test.xls");
echo "test1\t";
echo "test2\t\n";
echo "test1\t";
echo "test2\t\n";
echo "test1\t";
echo "test2\t\n";
echo "test1\t";
echo "test2\t\n";
echo "test1\t";
echo "test2\t\n";
echo "test1\t";
echo "test2\t\n";
?>
但在调用数据库时,原先的换行符在EXCEL表格中不支持,所以EXCEL表乱了……
求EXCEL表格格式控制的代码,或者求高手给预指点!
...全文
相关推荐
php生成excel表格
在描述中提到的"php生成excel表格下载"可能是指提供一个功能,让用户能够从PHP Web应用中下载生成的Excel文件。
php导出word文档与excel电子表格的简单示例代码
在进行PHP编程时,有时需要生成并导出Word文档或Excel电子表格。这对于数据导出、报表生成等场景非常有用。
PHP生成excel时单元格内换行问题的解决方法
这种方式可能不适用于需要复杂Excel特性的场景,但它为快速生成可下载的电子表格提供了一个简单有效的解决方案。
PHP根据模板公式导出excel表格(完整实例)
在PHP开发中,有时我们需要将数据导出为Excel表格,以方便数据分析或报表生成。"
php导入excel表格
在"php导入excel表格"这个主题中,我们将深入探讨如何使用PHP处理Excel文件,特别是涉及到多sheet页面的表格。


基础编程
