V
V
Vladimir2019-03-27 19:00:33
PHP
Vladimir, 2019-03-27 19:00:33

How to convert excel file ".xlsx" to ".xls" using PHP?

How to convert excel file from xlsx to xls using PHP?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir L, 2019-03-27
L

Made using the PHPExcel library

<?
require_once "xls/Classes/PHPExcel.php";
# Указываем путь до файла .xlsx
$file = "file_name.xlsx";
$name = str_replace('.xlsx', '', $file);
$pExcel = PHPExcel_IOFactory::load($file);
$objWriter = PHPExcel_IOFactory::createWriter($pExcel, 'Excel5');
$objWriter->save($name . '.xls');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question