Volver al ranking

viest/php-ext-xlswriter

Cxlswriter.viest.me

🚀 PHP Extension for creating and reader XLSX files.

phpexcelextensionxlsx-filesxlsx-writerxlsxwriterxlsxdllexcel-exportexcelwriterswoolelaravel
Crecimiento de estrellas
Estrellas
2.4k
Forks
236
Crecimiento semanal
Issues
5
1k2k
nov 2017sept 2020ago 2023jul 2026
README
php-ext-xlswriter
php-ext-xlswriter
php-ext-xlswriter
php-ext-xlswriter php-ext-xlswriter
php-ext-xlswriter php-ext-xlswriter php-ext-xlswriter
php-ext-xlswriter php-ext-xlswriter php-ext-xlswriter php-ext-xlswriter php-ext-xlswriter

Why use xlswriter

The chart below compares xlswriter with PhpSpreadsheet (the maintained successor to PHPExcel) when exporting an XLSX file, scaled all the way to Excel's row limit. Writing 1,048,576 rows × 10 columns, xlswriter is about 20× faster, and its fixed-memory mode keeps peak memory flat at ~30 MB no matter how many rows you write — whereas a pure-PHP library's memory grows with the data (≈7 GB for the same file).

xlswriter vs PhpSpreadsheet performance

The two xlswriter modes track within ~10% of each other on time. Fixed-memory mode is marginally faster because it streams each row straight to disk and frees it immediately — a single pass, with no full in-memory model to build up and then serialize a second time at the end. The trade-off is that, unlike normal mode, it can no longer revisit a cell once it has been written (and its strings are stored inline rather than de-duplicated, so the file can be slightly larger). Normal mode keeps the whole workbook in memory, which is what lets you write cells in any order and re-style them before saving.

xlswriter is a PHP C Extension for Excel 2007+ XLSX files. It writes text, numbers, formulas, dates, charts, images and hyperlinks to new workbooks, opens existing files to edit them and save the result, reads their contents back, and evaluates formulas to a computed value. It supports features such as:

Writer
  • 100% compatible Excel XLSX files.
  • Full Excel formatting.
  • Merged cells.
  • Defined names.
  • Autofilters.
  • Charts.
  • Data validation and drop down lists.
  • Conditional formatting.
  • Rich text, comments and hyperlinks.
  • Worksheet PNG/JPEG images.
  • Edit existing workbooks — open a file, update cell values, styles, merged ranges and row/column sizes, add worksheets, images and charts, then save the result.
  • Formula calculation — evaluate a formula and get its computed value, and write formulas with a pre-computed cached result.
  • Memory optimization mode for writing large files.
  • Works on Linux, FreeBSD, OpenBSD, OS X, Windows.
  • Compiles for 32 and 64 bit.
  • FreeBSD License.
  • The only dependency is on zlib.
Reader
  • Full read mode and cursor read mode.
  • Read by data type.
  • Read cell styles and number formats.
  • Read merged cells.
  • Read images, charts and comments.
  • Read formulas together with their cached values.

Install

Unix

Both install methods below build from source, so the zlib development headers must be present first (they are often missing on minimal images):

# Debian / Ubuntu
apt-get install -y zlib1g-dev
# Alpine
apk add zlib-dev
# RHEL / CentOS / Fedora
yum install -y zlib-devel

Then install with either PECL or PIE:

PECL

pecl install xlswriter

PIE

PIE also builds from source and additionally needs the autotools build chain (autoconf, make, a compiler and libtool). It can install those missing build tools for you with --auto-install-build-tools, but it cannot install zlib — make sure the headers above are in place first:

pie install --auto-install-build-tools viest/xlswriter
Windows

download dll

Benchmark

Test environment: Macbook Pro 13 inch, Intel Core i5, 16GB 2133MHz LPDDR3 Memory, 128GB SSD Storage.

Export

Two memory modes export 1 million rows of data (27 columns, data is string)

  • Normal mode: only 29S is needed, and the memory only needs 2083MB;
  • Fixed memory mode: only need 52S, memory only needs <1MB;
Import

1 million rows of data (1 columns, data is inter)

  • Full mode: Just 3S, the memory is only 558MB;
  • Cursor mode: Just 2.8S, memory is only <1MB;

Documents

Includes extensive and detailed instructions that make it easy to get started with xlswriter.

PECL Repository

pecl

IDE Helper

composer require viest/php-ext-xlswriter-ide-helper:dev-master

Contributors

Code Contributors

This project exists thanks to all the people who contribute. [Contribute].

Financial Contributors

Become a financial contributor and help us sustain our community. [Contribute]

Individuals

Organizations

Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]

License

BSD License

FOSSA Status

Stargazers over time

Stargazers over time

Repositorios relacionados
laravel/laravel

Laravel is a web application framework with expressive, elegant syntax. We’ve already laid the foundation for your next big idea — freeing you to create without sweating the small things.

Bladephpframework
laravel.com
84.6k24.8k
coollabsio/coolify

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 280+ one-click services on your own servers.

PHPPackagistApache License 2.0nodejsmysql
coolify.io
59.2k5.1k
LeCoupa/awesome-cheatsheets

👩‍💻👨‍💻 Awesome cheatsheets for popular programming languages, frameworks and development tools. They include everything you should know in one single file.

JavaScriptnpmMIT Licensecheatsheetsjavascript
lecoupa.github.io/awesome-cheatsheets/
46.2k6.7k
nextcloud/server

☁️ Nextcloud server, a safe home for all your data

PHPPackagistGNU Affero General Public License v3.0open-sourcefile-sharing
nextcloud.com
36.2k5.1k
laravel/framework

Laravel is a web application framework with expressive, elegant syntax.

PHPPackagistMIT Licensephpframework
laravel.com
34.8k11.9k
ziadoz/awesome-php

A curated list of amazingly awesome PHP libraries, resources and shiny things.

Do What The F*ck You Want To Public Licensephpphp-framework
32.6k5.1k
symfony/symfony

The Symfony PHP framework

PHPPackagistMIT Licenseframeworkphp
symfony.com
31.1k9.8k
composer/composer

Dependency Manager for PHP

PHPPackagistMIT Licensephpcomposer
getcomposer.org
29.5k4.8k
bagisto/bagisto

Free and open source laravel eCommerce platform

PHPPackagistMIT Licenseecommerce-frameworklaravel
bagisto.com
27.8k3.2k
monicahq/monica

Personal CRM. Remember everything about your friends, family and business relationships.

PHPPackagistGNU Affero General Public License v3.0laravelcrm
beta.monicahq.com
24.9k2.6k
firefly-iii/firefly-iii

Firefly III: a personal finances manager

PHPPackagistGNU Affero General Public License v3.0phpmoney
firefly-iii.org
24.1k2.2k
guzzle/guzzle

Guzzle, an extensible PHP HTTP client

PHPPackagistMIT Licenseguzzlepsr-7
23.5k2.4k