Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/redis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 下载包含多张工作表的Excel文件_Php_Excel - Fatal编程技术网

Php 下载包含多张工作表的Excel文件

Php 下载包含多张工作表的Excel文件,php,excel,Php,Excel,我想下载一个excel文件,其中包含三个使用PHP的工作表。有人能帮我吗 试试看如果我站得正确,您需要从PHP生成一个Excel文件 如果是这样,请看一个名为 在中,有一个示例看起来有点像您要实现的目标: <?php require_once 'Spreadsheet/Excel/Writer.php'; // Creating a workbook $workbook = new Spreadsheet_Excel_Writer(); // sending HTTP headers

我想下载一个excel文件,其中包含三个使用PHP的工作表。有人能帮我吗

试试看

如果我站得正确,您需要从PHP生成一个Excel文件

如果是这样,请看一个名为

在中,有一个示例看起来有点像您要实现的目标:

<?php
require_once 'Spreadsheet/Excel/Writer.php';

// Creating a workbook
$workbook = new Spreadsheet_Excel_Writer();

// sending HTTP headers
$workbook->send('test.xls');

// Creating a worksheet
$worksheet =& $workbook->addWorksheet('My first worksheet');

// The actual data
$worksheet->write(0, 0, 'Name');
$worksheet->write(0, 1, 'Age');
$worksheet->write(1, 0, 'John Smith');
$worksheet->write(1, 1, 30);
$worksheet->write(2, 0, 'Johann Schmidt');
$worksheet->write(2, 1, 31);
$worksheet->write(3, 0, 'Juan Herrera');
$worksheet->write(3, 1, 32);

// Let's send the file
$workbook->close();
?>