我能够从任何excel文件中读取数据,但是当我试图将一些数据写入excel文件时,php文件不工作。
A code I tried:
<?php
include 'PHPExcel/IOFactory.php';
$fileType = 'Excel2007';
$fileName = 'output.xlsx';
$objReader = PHPExcel_IOFactory::createReader($fileType);
$objPHPExcel = $objReader->load($fileName);
$objPHPExcel->setActiveSheetIndex(0)
->setCellValue('A1', 'Hello')
->setCellValue('B1', 'World!');
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $fileType);
$objWriter->save($fileName);
?>
将'output.xlsx'目标文件夹更改为完全权限777