Answer the question
In order to leave comments, you need to log in
PHP Excel. Why is not a "complete" file formed?
Greetings! I take the .csv
file and convert it to .xlsx in this way:
file_put_contents($_SERVER["DOCUMENT_ROOT"].'/files/csv.csv',
file_get_contents('http://site.ru/files/input.csv')
);
// Перевод в .xlsx
$objReader = PHPExcel_IOFactory::createReader('CSV')
->setDelimiter(";");
$csv = $objReader->load($_SERVER["DOCUMENT_ROOT"].'/files/csv.csv');
$writer= PHPExcel_IOFactory::createWriter($csv, 'Excel2007');
$writer->save($_SERVER["DOCUMENT_ROOT"]."/files/result.xlsx");
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question