PHP library for reading / writing MS Excel files?

Is there a free PHP library for reading / writing excel files? I do not want to use XML (I think you could read excel files as XML, I do not want to do this). I also need to create graphs and other useful properties, so saving the file as csv will not work either.

+3
source share
4 answers

Perhaps http://phpexcel.codeplex.com/ is what you are looking for?

+4
source

, / excel : -

http://phpexcel.codeplex.com/

<?php 
error_reporting(E_ALL);
date_default_timezone_set('Europe/London');
require_once '../Classes/PHPExcel/IOFactory.php';
require_once '../Classes/PHPExcel.php';
$excel2 = PHPExcel_IOFactory::createReader('Excel2007');

/*Enable chart read on excel*/
$excel2->setIncludeCharts(TRUE);
/*Enable chart read on excel*/

$excel2 = $excel2->load('excelname.xlsx'); // Empty Sheet

/*update cell data if you required */
$excel2->getActiveSheet()->setCellValue('B6', '2');
$excel2->getActiveSheet()->setCellValue('B7', '1');
$excel2->getActiveSheet()->setCellValue('B8', '3');
/*-----------------------------*/

$objWriter = PHPExcel_IOFactory::createWriter($excel2, 'Excel2007');
/*Enable chart write on excel*/
$objWriter->setIncludeCharts(TRUE);
/*Enable chart write on excel*/
$objWriter->save('excelout.xlsx');
?>
0

PHP- MS-Excel Stream Handler, :

, / excel php-.

0

Source: https://habr.com/ru/post/1789994/


All Articles