nextCellCallback(callable $callback, string $sheetName = NULL): void
function(int $row, int $cell, string|double|int $data)
$config = ['path' => './tests'];
$excel = new \Vtiful\Kernel\Excel($config);
$filePath = $excel->fileName('tutorial.xlsx')
->header(['Item', 'Cost'])
->data([
['Item_1', 'Cost_1'],
])
->output();
$excel->openFile('tutorial.xlsx')->nextCellCallback(function ($row, $cell, $data) {
echo 'cell:' . $cell . ', row:' . $row . ', value:' . $data . PHP_EOL;
});
cell:0, row:0, value:Item
cell:1, row:0, value:Cost
cell:1, row:0, value:XLSX_ROW_END // 结束标识
cell:0, row:1, value:Item_1
cell:1, row:1, value:Cost_1
cell:1, row:1, value:XLSX_ROW_END // 结束标识