I'm trying to write 18000 rows x 42 cols. The values from col 'E' to 'DD' must set with value 0. I'm trying to use increment but I found that is caused memory exhausted.
My Code is like this :
$col = $lastcol;
foreach ($diag0 as $key) {
$sheet->setCellValue('A'.(string)($col + 1), '0');
$sheet->setCellValue('B'.(string)($col + 1), $key->cdDiag);
$sheet->setCellValue('D'.(string)($col + 1), $key->nmDiag);
for ($char='E'; $char <= 'J' ; $char++) {
$sheet->setCellValue($char.(string)($col + 1), '0');
}
$col++;
}
I'd trying the PHPExcel cached config, but it still give the same result. I think since the col 'E' to 'DD' is have the same value, can I make it like set 'E' to 'DD' with 0 at one loop?