# PhpSpreadsheet
[![Build Status](https://github.com/PHPOffice/PhpSpreadsheet/workflows/main/badge.svg)](https://github.com/PHPOffice/PhpSpreadsheet/actions)
[![Code Quality](https://scrutinizer-ci.com/g/PHPOffice/PhpSpreadsheet/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/PHPOffice/PhpSpreadsheet/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/PHPOffice/PhpSpreadsheet/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/PHPOffice/PhpSpreadsheet/?branch=master)
[![Total Downloads](https://img.shields.io/packagist/dt/PHPOffice/PhpSpreadsheet)](https://packagist.org/packages/phpoffice/phpspreadsheet)
[![Latest Stable Version](https://img.shields.io/github/v/release/PHPOffice/PhpSpreadsheet)](https://packagist.org/packages/phpoffice/phpspreadsheet)
[![License](https://img.shields.io/github/license/PHPOffice/PhpSpreadsheet)](https://packagist.org/packages/phpoffice/phpspreadsheet)
[![Join the chat at https://gitter.im/PHPOffice/PhpSpreadsheet](https://img.shields.io/badge/GITTER-join%20chat-green.svg)](https://gitter.im/PHPOffice/PhpSpreadsheet)
PhpSpreadsheet is a library written in pure PHP and offers a set of classes that
allow you to read and write various spreadsheet file formats such as Excel and LibreOffice Calc.
## PHP Version Support
LTS: Support for PHP versions will only be maintained for a period of six months beyond the
[end of life](https://www.php.net/supported-versions) of that PHP version.
Currently the required PHP minimum version is PHP __7.4__, and we [will support that version](https://www.php.net/eol.php) until 28th June 2023.
See the `composer.json` for other requirements.
## Installation
Use [composer](https://getcomposer.org) to install PhpSpreadsheet into your project:
```sh
composer require phpoffice/phpspreadsheet
```
If you are building your installation on a development machine that is on a different PHP version to the server where it will be deployed, or if your PHP CLI version is not the same as your run-time such as `php-fpm` or Apache's `mod_php`, then you might want to add the following to your `composer.json` before installing:
```json
{
"require": {
"phpoffice/phpspreadsheet": "^1.28"
},
"config": {
"platform": {
"php": "7.4"
}
}
}
```
and then run
```sh
composer install
```
to ensure that the correct dependencies are retrieved to match your deployment environment.
See [CLI vs Application run-time](https://php.watch/articles/composer-platform-check) for more details.
### Additional Installation Options
If you want to write to PDF, or to include Charts when you write to HTML or PDF, then you will need to install additional libraries:
#### PDF
For PDF Generation, you can install any of the following, and then configure PhpSpreadsheet to indicate which library you are going to use:
- mpdf/mpdf
- dompdf/dompdf
- tecnickcom/tcpdf
and configure PhpSpreadsheet using:
```php
// Dompdf, Mpdf or Tcpdf (as appropriate)
$className = \PhpOffice\PhpSpreadsheet\Writer\Pdf\Dompdf::class;
IOFactory::registerWriter('Pdf', $className);
```
or the appropriate PDF Writer wrapper for the library that you have chosen to install.
#### Chart Export
For Chart export, we support following packages, which you will also need to install yourself using `composer require`
- [jpgraph/jpgraph](https://packagist.org/packages/jpgraph/jpgraph) (this package was abandoned at version 4.0.
You can manually download the latest version that supports PHP 8 and above from [jpgraph.net](https://jpgraph.net/))
- [mitoteam/jpgraph](https://packagist.org/packages/mitoteam/jpgraph) - fork with modern PHP versions support.
and then configure PhpSpreadsheet using:
```php
// to use jpgraph/jpgraph
Settings::setChartRenderer(\PhpOffice\PhpSpreadsheet\Chart\Renderer\JpGraph::class);
//or
// to use mitoteam/jpgraph
Settings::setChartRenderer(\PhpOffice\PhpSpreadsheet\Chart\Renderer\MtJpGraphRenderer::class);
```
One or the other of these libraries is necessary if you want to generate HTML or PDF files that include charts; or to render a Chart to an Image format from within your code.
They are not necessary to define charts for writing to `Xlsx` files.
Other file formats don't support writing Charts.
## Documentation
Read more about it, including install instructions, in the [official documentation](https://phpspreadsheet.readthedocs.io). Or check out the [API documentation](https://phpoffice.github.io/PhpSpreadsheet).
Please ask your support questions on [StackOverflow](https://stackoverflow.com/questions/tagged/phpspreadsheet), or have a quick chat on [Gitter](https://gitter.im/PHPOffice/PhpSpreadsheet).
## Patreon
I am now running a [Patreon](https://www.patreon.com/MarkBaker) to support the work that I do on PhpSpreadsheet.
Supporters will receive access to articles about working with PhpSpreadsheet, and how to use some of its more advanced features.
Posts already available to Patreon supporters:
- The Dating Game
- A look at how MS Excel (and PhpSpreadsheet) handle date and time values.
- Looping the Loop
- Advice on Iterating through the rows and cells in a worksheet.
And for Patrons at levels actively using PhpSpreadsheet:
- Behind the Mask
- A look at Number Format Masks.
The Next Article (currently Work in Progress):
- Formula for Success
- How to debug formulae that don't produce the expected result.
My aim is to post at least one article each month, taking a detailed look at some feature of MS Excel and how to use that feature in PhpSpreadsheet, or on how to perform different activities in PhpSpreadsheet.
Planned posts for the future include topics like:
- Tables
- Structured References
- AutoFiltering
- Array Formulae
- Conditional Formatting
- Data Validation
- Value Binders
- Images
- Charts
After a period of six months exclusive to Patreon supporters, articles will be incorporated into the public documentation for the library.
## PHPExcel vs PhpSpreadsheet ?
PhpSpreadsheet is the next version of PHPExcel. It breaks compatibility to dramatically improve the code base quality (namespaces, PSR compliance, use of latest PHP language features, etc.).
Because all efforts have shifted to PhpSpreadsheet, PHPExcel will no longer be maintained. All contributions for PHPExcel, patches and new features, should target PhpSpreadsheet `master` branch.
Do you need to migrate? There is [an automated tool](/docs/topics/migration-from-PHPExcel.md) for that.
## License
PhpSpreadsheet is licensed under [MIT](https://github.com/PHPOffice/PhpSpreadsheet/blob/master/LICENSE).
没有合适的资源?快使用搜索试试~ 我知道了~
phpoffice/phpspreadsheet完整包
共549个文件
php:503个
config:18个
functions:17个
需积分: 0 40 下载量 125 浏览量
2023-05-12
09:56:21
上传
评论
收藏 1.21MB ZIP 举报
温馨提示
PhpSpreadsheet 是一个用于读写电子表格文件的 PHP 库,是 PHPExcel 的升级版,PHPExcel 已经停止更新和维护,但是 PhpSpreadsheet 有以下改进: 支持更多电子表格格式:PhpSpreadsheet 支持读写 Microsoft Excel 2007 及以上版本的 .xlsx 和 .xlsm 文件,同时也支持 OpenOffice 和 LibreOffice 使用的 .ods 文件格式,以及其他常见电子表格格式。而 PHPExcel 只支持 Microsoft Excel 的 .xls 格式。 更好的性能:PhpSpreadsheet 使用了更好的代码结构和算法,相比于 PHPExcel 能够更快地处理大型电子表格文件,同时也更加稳定。 更好的兼容性:由于 PhpSpreadsheet 支持更多的电子表格文件格式,它可以更好地与其他软件和系统进行交互。 因此,如果您需要使用 PHP 读写电子表格文件,建议使用 PhpSpreadsheet 代替 PHPExcel。
资源推荐
资源详情
资源评论
收起资源包目录
phpoffice/phpspreadsheet完整包 (549个子文件)
config 374B
config 354B
config 349B
config 345B
config 337B
config 336B
config 335B
config 334B
config 332B
config 330B
config 315B
config 311B
config 307B
config 304B
config 301B
config 298B
config 280B
config 71B
phpstan.neon.dist 1KB
.phpcs.xml.dist 752B
phpunit10.xml.dist 617B
functions 52KB
functions 14KB
functions 11KB
functions 11KB
functions 11KB
functions 11KB
functions 10KB
functions 10KB
functions 10KB
functions 10KB
functions 10KB
functions 10KB
functions 10KB
functions 10KB
functions 10KB
functions 10KB
functions 9KB
composer.json 4KB
LICENSE 1KB
CHANGELOG.md 107KB
README.md 6KB
CONTRIBUTING.md 3KB
phpstan-baseline.neon 1KB
Xls.php 287KB
Calculation.php 243KB
Xlsx.php 130KB
Worksheet.php 116KB
Worksheet.php 113KB
Chart.php 76KB
Chart.php 75KB
Html.php 62KB
Worksheet.php 62KB
Financial.php 60KB
Statistical.php 55KB
ReferenceHelper.php 54KB
Parser.php 54KB
Engineering.php 52KB
Spreadsheet.php 45KB
MathTrig.php 41KB
AutoFilter.php 41KB
Workbook.php 41KB
Html.php 36KB
Xls.php 35KB
DateTime.php 35KB
ConvertUOM.php 35KB
Ods.php 33KB
JpGraphRendererBase.php 32KB
Properties.php 31KB
Style.php 27KB
PageSetup.php 27KB
Style.php 27KB
Roman.php 26KB
Html.php 25KB
Xlsx.php 25KB
Font.php 24KB
Database.php 23KB
StringHelper.php 23KB
Font.php 23KB
Cell.php 22KB
FormulaParser.php 22KB
Drawing.php 21KB
Gnumeric.php 21KB
Theme.php 21KB
Xml.php 21KB
Coordinate.php 21KB
Slk.php 20KB
ComplexFunctions.php 19KB
Escher.php 19KB
Date.php 19KB
Csv.php 19KB
Functions.php 19KB
Coupons.php 18KB
Escher.php 18KB
OLE.php 17KB
Table.php 17KB
Rels.php 16KB
LookupRef.php 16KB
Styles.php 16KB
Chart.php 16KB
共 549 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
啊喃
- 粉丝: 4
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 农村信用社联合社计算机信息系统投产与变更管理办.docx
- 农村信用社联合社计算机信息系统数据管理办法.docx
- 利用SPSS作临床效度分析线上计算网站介绍-医学研究部统计谘.(医学PPT课件).ppt
- 利用Zabbix监控mysqldump定时备份数据库状态.docx
- 利用计算机解决问题的基本过程.doc
- 化工铁路通信工程总结.doc
- 北京大学网络教育软件工程作业.docx
- 医药公司(连锁店)计算机操作规程未新系统的自行按照旧制修改-新系统过制的编号加修模版.doc
- 医药公司(连锁店)计算机系统操作规程模版.doc
- 医药连锁门店计算机系统的操作和管理程序未新系统的自行按照旧制修改-新系统过制的编号加修模版.docx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功