XLSX转为CSV - 回调模式
应用场景
函数原型
putCSVCallback(callable $callback, resource $handler): boolcallable $callback
resource $handler
示例
$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