Answer the question
In order to leave comments, you need to log in
To in the PHPExcel library to load the file contained in the variable?
<?
require_once "xls/Classes/PHPExcel.php";
$file = file_get_contents("name_file.xlsx");
$pExcel = PHPExcel_IOFactory::load($file);
$objWriter = PHPExcel_IOFactory::createWriter($pExcel, 'Excel5');
$objWriter->save('name_file' . '.xls');
Answer the question
In order to leave comments, you need to log in
Why read the content first and then push it into phpexcel if it has its own data reading method?
And another point: you are reading an xlsx file, and you are trying to process it as Excel5 (this is the old xls format)
require_once 'Classes/PHPExcel/IOFactory.php';
$file='name_file.xlsx';
$objReader = PHPExcel_IOFactory::createReader('Excel2007');
$xls = $objReader->load($file);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question