我收到以下错误,我试图找出是代码中有错误还是模板引起错误。我可以根据需要上载模板,但以为我会检查是否遗漏了明显的东西,或者首先是已知问题。
注意:未定义的偏移量:2 in /vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Calculation.php 在3472行上
警告:trim()期望参数1为字符串,数组形式为 /vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Calculation.php 在3680行
require 'vendor/autoload.php';
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader('Xlsx');
$spreadsheet = $reader->load("template.xlsx");
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xlsx');
$writer->save('php://output');
exit;
编辑//我尝试了其他模板,但没有收到错误,因此可以找到模板here ...