require_once("05featuredemo.inc.php"); require_once('Classes/PHPExcel/Writer/HTML.php'); //Write to HTML format $objWriter = new PHPExcel_Writer_HTML($objPHPExcel); $objWriter->setSheetIndex(0); $objWriter->save(str_replace('.php', '.htm', __FILE__));
6.写pdf
require_once("05featuredemo.inc.php"); require_once('Classes/PHPExcel/IOFactory.php'); //Write to PDF format $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'PDF'); $objWriter->setSheetIndex(0); $objWriter->save(str_replace('.php', '.pdf', __FILE__)); //Echo memory peak usage echo date('H:i:s')." Peak memory usage: ".(memory_get_peak_usage(true) / 1024 / 1024)." MB\r\n";