XLSX to CSV - Callback function mode
Application scenario
Function prototype
putCSVCallback(callable $callback, resource $handler): boolcallable $ callback
resource $ handler
Example
$config = ['path' => './tests'];
$excel = new \Vtiful\Kernel\Excel ($config);
$filePath = $excel-> fileName('tutorial.xlsx', 'TestSheet1')
->header(['String', 'Int', 'Double'])
->data([
['Item_1', 10, 10.9999995],
])
->output ();
$fp = fopen ('./ tests / file.csv', 'w');
$csvResult = $excel->openFile('tutorial.xlsx')
->openSheet()
->putCSVCallback(function (array $row) {
return $row;
}, $fp);Last updated