Dates turn into 44898, leading zeros vanish from SKUs, card numbers become 8.98E+18. Those are not bugs — that is how Excel stores values. Learn to type your data correctly when exporting to XLSX with FastExcelWriter.
Word has mail merge: you take a template with fields and drop the data in. Excel appears to have nothing of the sort out of the box — so developers start assembling documents cell by cell in code. In fact, substituting values into a ready XLSX takes two lines: placeholders, the fill/replace difference, and the usual traps.
Does your Excel export die with an out-of-memory error on large data? The cause is the “whole workbook in memory” object model. Here is how to write a million rows to XLSX with flat memory use in plain PHP: FastExcelWriter's row → temp file → ZIP streaming scheme.
The accountant has already drawn the invoice form in Excel — with a logo, borders, number formats, and formulas. There is no need to reproduce that in code: FastExcelTemplator takes the ready XLSX as a template, substitutes data for the placeholders, and repeats table rows while keeping the formatting.
You need Excel in PHP, and the very first search result is PhpSpreadsheet — universal, heavy, and not always the right fit. Let's sort out what kinds of Excel tasks actually exist (reading, writing, templates) and how to tell which one is yours, so you don't haul in a combine harvester where a screwdriver would do.
We had barely finished the post about 4.0 when 4.1 and 4.2 shipped. Here is what changed: Excel::open() now detects the format from the file signature and reads XLSX, XLS, and CSV in a single line — no more branching on the file extension.
FastExcelReader 4 reads the old XLS format (Excel 97–2003) through exactly the same methods you already use for XLSX — no second library, no branching in your code. withHeader() now accepts your own column names, and XLSX reading got about 1.5 times faster. A walkthrough of what version 4 brings.
PhpSpreadsheet burns hundreds of megabytes even on small files and dies outright on large ones. If your job is to read data out of Excel rather than edit a workbook, there is a sharper tool: FastExcelReader streams XLSX and CSV — fast and with almost flat memory — without losing dates, styles, merged cells or images. An overview of the reader.