setSheetIndex(0); //$objWriter->setImagesRoot('http://www.example.com'); $objWriter->save(str_replace('.php', '.htm', __FILE__)); // Echo memory peak usage echo date('H:i:s') . " Peak memory usage: " . (memory_get_peak_usage(true) / 1024 / 1024) . " MB\r\n"; // Echo done echo date('H:i:s') . " Done writing files.\r\n";