Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
S

simplexlsxgen

> 编程语言
Open source

Export data to Excel. PHP XLSX generator

1.1K stars0 likes0 views
WebsiteGitHub

About

Export data to Excel. PHP XLSX generator

SimpleXLSXGen

Export data to Excel XLSX file. PHP XLSX generator. No external tools and libraries.

  • XLSX reader here
  • XLS reader here
  • CSV reader/writer here

Sergey Shuchkin 2020-2025

Hey, bro, please ★ the package for my motivation :) and donate for more motivation!

Basic Usage

php
$books = [
    ['ISBN', 'title', 'author', 'publisher', 'ctry' ],
    [618260307, 'The Hobbit', 'J. R. R. Tolkien', 'Houghton Mifflin', 'USA'],
    [908606664, 'Slinky Malinki', 'Lynley Dodd', 'Mallinson Rendel', 'NZ']
];
$xlsx = Shuchkin\SimpleXLSXGen::fromArray( $books );
$xlsx->saveAs('books.xlsx'); // or downloadAs('books.xlsx') or $xlsx_content = (string) $xlsx 

Installation

The recommended way to install this library is through Composer. New to Composer?

This will install the latest supported version:

bash
$ composer require shuchkin/simplexlsxgen

or download class here

Examples

Use UTF-8 encoded strings.

Data types

…

Formatting

…

RAW Strings

Prefix #0 cell value (use double quotes) or use ::raw() ::rawArray() methods or tag ``````

php
$PushkinDOB = '1799-07-06';
$data = [
    ['Datetime as raw string', "\0" . '2023-01-09 11:16:34'],
    ['Date as raw string', "\0" . $PushkinDOB],
    ['Disable type detection', "\0" . '+12345'],
    ['Method ::raw, insert greater/less them simbols', SimpleXLSXGen::raw('20- short term: +123456 &lt;tag&gt;'],
];
SimpleXLSXGen::fromArray($data)
    ->saveAs('test_rawstrings.xlsx');

$data = [
    ['test', 'raw', 'array'],
    ['2025-08-09 14:36:34', '', 1]
];
$raw_data = SimpleXLSXGen::rawArray($data);
SimpleXLSXGen::fromArray($raw_data)->saveAs('test_raw_array.xlsx');

More examples

…

JS array to Excel (AJAX)

php
downloadAs('file.xlsx');
    return;
}
?>

    JS array to Excel

Debug

php
ini_set('error_reporting', E_ALL );
ini_set('display_errors', 1 );

$data = [
    ['Debug', 123]
];

Shuchkin\SimpleXLSXGen::fromArray( $data )->saveAs('debug.xlsx');

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

PHPphpxlsxxlsxwriter

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言