PHP阅读xlsx Excel 2007文件

时间:2021-11-23 16:57:16

I am using oleread to read uploaded xls file. But I am not able to read xlsx files saved in excel-2007 format. can someone help me on how to read xlsx file in PHP.

我正在使用oleread来读取上传的xls文件。但我无法读取以excel-2007格式保存的xlsx文件。有人可以帮助我如何在PHP中读取xlsx文件。

2 个解决方案

#1


36  

<?php
require_once 'simplexlsx.class.php';

if ( $xlsx = SimpleXLSX::parse('pricelist.xlsx') ) {
  print_r( $xlsx->rows() );
} else {
  echo SimpleXLSX::parse_error();
}
?>

SimpleXLSX

SimpleXLSX

#2


18  

PHPExcel (see GitHub repository) is probably your best option. It's very slick and easy to use, I've had no problem with the new XLSX format.

PHPExcel(请参阅GitHub存储库)可能是您的最佳选择。它非常灵活且易于使用,我对新的XLSX格式没有任何问题。

#1


36  

<?php
require_once 'simplexlsx.class.php';

if ( $xlsx = SimpleXLSX::parse('pricelist.xlsx') ) {
  print_r( $xlsx->rows() );
} else {
  echo SimpleXLSX::parse_error();
}
?>

SimpleXLSX

SimpleXLSX

#2


18  

PHPExcel (see GitHub repository) is probably your best option. It's very slick and easy to use, I've had no problem with the new XLSX format.

PHPExcel(请参阅GitHub存储库)可能是您的最佳选择。它非常灵活且易于使用,我对新的XLSX格式没有任何问题。