Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/289.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/arrays/12.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_Arrays_Excel - Fatal编程技术网

使用PHP将存储在数组中的数据写入多个excel工作表

使用PHP将存储在数组中的数据写入多个excel工作表,php,arrays,excel,Php,Arrays,Excel,我有两个关联数组,我必须在一个excel文件中的两张不同的表上写入它们 这就是我尝试使用一个数组的单页 <?php header('Content-type: application/ms-excel'); $excel_name=$_POST['excel_name']; header('Content-Disposition: attachment; filename="'.$excel_name.'.xls"'); print_r($_POST['html_excel']); ?&

我有两个关联数组,我必须在一个excel文件中的两张不同的表上写入它们

这就是我尝试使用一个数组的单页

<?php header('Content-type: application/ms-excel');
$excel_name=$_POST['excel_name'];
header('Content-Disposition: attachment; filename="'.$excel_name.'.xls"');
print_r($_POST['html_excel']); 
?>

看一下Thank you RiggsFolly,但我不想使用任何库。我希望它的操作方式与我对单个excel工作表所做的相同,那么您将如何告诉它工作表名称。这就是建议建立一个图书馆的目的。是否可以像我在上面创建excel表格时所做的那样,在一个excel表格中创建多个工作簿?因为你没有办法告诉excel表格使用,所以我看不到明显的方法。尽管我必须承认我从来没有像你那样做过。