0
$inputFileType = PHPExcel_IOFactory::identify($path . '/' . $fileName);
$objReader = PHPExcel_IOFactory::createReader($inputFileType);
$objPHPExcel = $objReader->load($path . '/' . $fileName);
//temp sheet copy 2 times
for ($pageIndex=1; $pageIndex <= 2; $pageIndex++) {
$tempSheet = $objPHPExcel->getSheet(0)->copy();
$tempSheet->setTitle('Page ' . $pageIndex);
$objPHPExcel->addSheet($tempSheet);
unset($tempSheet);
}
$sheet = $objPHPExcel->getSheet(1);
$sheet->setCellValueExplicitByColumnAndRow(0, 1, 'TEST', PHPExcel_Cell_DataType::TYPE_STRING);
我複製一個Excel表2次,我只是做2.此更改適用頁面上更改PHPExcel複製片和改變
不要使用複製,因爲這是一個「淺」的副本;使用克隆 –
我用克隆,但沒有改變? – erhan