{"id":20170738,"url":"https://github.com/pear/spreadsheet_excel_writer","last_synced_at":"2025-10-19T03:35:26.792Z","repository":{"id":2311159,"uuid":"3270809","full_name":"pear/Spreadsheet_Excel_Writer","owner":"pear","description":"Allows writing of Excel spreadsheets. Since 2002.","archived":false,"fork":false,"pushed_at":"2022-08-10T08:58:14.000Z","size":279,"stargazers_count":43,"open_issues_count":1,"forks_count":62,"subscribers_count":24,"default_branch":"master","last_synced_at":"2025-03-29T16:05:15.649Z","etag":null,"topics":["excel","php"],"latest_commit_sha":null,"homepage":"http://pear.php.net/package/Spreadsheet_Excel_Writer","language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pear.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-01-26T02:52:41.000Z","updated_at":"2024-06-11T20:44:17.000Z","dependencies_parsed_at":"2022-07-16T01:30:36.690Z","dependency_job_id":null,"html_url":"https://github.com/pear/Spreadsheet_Excel_Writer","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pear%2FSpreadsheet_Excel_Writer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pear%2FSpreadsheet_Excel_Writer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pear%2FSpreadsheet_Excel_Writer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pear%2FSpreadsheet_Excel_Writer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pear","download_url":"https://codeload.github.com/pear/Spreadsheet_Excel_Writer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247369952,"owners_count":20927928,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["excel","php"],"created_at":"2024-11-14T01:20:30.043Z","updated_at":"2025-10-19T03:35:26.774Z","avatar_url":"https://github.com/pear.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Continuous Integration](https://github.com/pear/Spreadsheet_Excel_Writer/actions/workflows/ci.yaml/badge.svg)](https://github.com/pear/Spreadsheet_Excel_Writer/actions/workflows/ci.yaml)\n[![Latest Stable Version](https://poser.pugx.org/pear/spreadsheet_excel_writer/v/stable)](https://packagist.org/packages/pear/spreadsheet_excel_writer)\n[![Coverage Status](https://coveralls.io/repos/github/pear/Spreadsheet_Excel_Writer/badge.svg?branch=master)](https://coveralls.io/github/pear/Spreadsheet_Excel_Writer?branch=master)\n\n# Spreadsheet_Excel_Writer\n\nThis package is [Spreadsheet_Excel_Writer](http://pear.php.net/package/Spreadsheet_Excel_Writer) and has been migrated from [svn.php.net](https://svn.php.net/repository/pear/packages/Spreadsheet_Excel_Writer).\n\nPlease report all new issues [via the PEAR bug tracker](http://pear.php.net/bugs/search.php?cmd=display\u0026package_name[]=Spreadsheet_Excel_Writer\u0026order_by=ts1\u0026direction=DESC\u0026status=Open).\n\nIf this package is marked as unmaintained and you have fixes, please submit your pull requests and start discussion on the pear-qa mailing list.\n\n\n# Installation\n\n## Pear\n\nTo test, run\n\n    $ phpunit\n\nTo build, simply\n\n    $ pear package\n\nTo install from scratch\n\n    $ pear install package.xml\n\nTo upgrade\n\n    $ pear upgrade -f package.xml\n\n## Composer\n\nThis package comes with support for Composer.\n\nTo install from Composer\n\n    $ composer require pear/spreadsheet_excel_writer\n\nTo install the latest development version\n\n    $ composer require pear/spreadsheet_excel_writer:dev-master\n\n# Features\n\n- writing Excel (.XLS) spreadsheets\n- support: strings (with formatting for text and cells), formulas, images (BMP) \n\n# Limitations\nLibrary support only 2 types of format for writing XLS, also known as Binary Interchange File Format ([BIFF](https://www.openoffice.org/sc/excelfileformat.pdf)): \n- BIFF5 (Excel 5.0 - Excel 95)\n- BIFF8 (Excel 98 - Excel 2003)\n\n**Some important limitations:**  \n\n| Limit | BIFF5 | BIFF8 |\n| --- | --- | --- |\n| Maximum number of rows | 16384 | 65535 |\n| Maximum number of columns | 255 | 255 |\n| Maximum data size of a record | 2080 bytes | 8224 bytes |\n| Unicode support | CodePage based character encoding | UTF-16LE |\n\nExplanation of formats and specifications you can find [here](https://www.loc.gov/preservation/digital/formats/fdd/fdd000510.shtml) (section \"Useful references\")\n\nCorrect output only guaranteed with `mbstring.func_overload = 0` otherwise, you should use workround `mb_internal_encoding('latin1');` \n\n# Usage\n\n## Basic usage\n```php\nuse Spreadsheet_Excel_Writer;\n\n\n$filePath = __DIR__ . '/output/out.xls';\n$xls = new Spreadsheet_Excel_Writer($filePath);\n\n// 8 = BIFF8\n$xls-\u003esetVersion(8);\n\n$sheet = $xls-\u003eaddWorksheet('info');\n\n// only available with BIFF8\n$sheet-\u003esetInputEncoding('UTF-8');\n\n$headers = [\n    'id',\n    'name',\n    'email',\n    'code',\n    'address'\n];\n\n$row = $col = 0;\nforeach ($headers as $header) {\n    $sheet-\u003ewrite($row, $col, $header);\n    $col++;\n}\n\nfor ($id = 1; $id \u003c 100; $id++) {\n    $data = [\n        'id' =\u003e $id,\n        'name' =\u003e 'Name Surname',\n        'email' =\u003e 'mail@gmail.com',\n        'password' =\u003e 'cfcd208495d565ef66e7dff9f98764da',\n        'address' =\u003e '00000 North Tantau Avenue. Cupertino, CA 12345. (000) 1234567'\n    ];\n    $sheet-\u003ewriteRow($id, 0, $data);\n}\n\n$xls-\u003eclose();\n```\n\n## Format usage\n```php\n$xls = new Spreadsheet_Excel_Writer();\n\n$titleFormat = $xls-\u003eaddFormat(); \n$titleFormat-\u003esetFontFamily('Helvetica');\n$titleFormat-\u003esetBold();\n$titleFormat-\u003esetSize(10);\n$titleFormat-\u003esetColor('orange'); \n$titleFormat-\u003esetBorder(1);\n$titleFormat-\u003esetBottom(2);\n$titleFormat-\u003esetBottomColor(44);\n$titleFormat-\u003esetAlign('center');\n\n$sheet = $xls-\u003eaddWorksheet('info'); \n\n$sheet-\u003ewrite(0, 0, 'Text 123', $titleFormat);\n```\n\n## Header usage (Sending HTTP header for download dialog)\n```php\n$xls = new Spreadsheet_Excel_Writer();\n$xls-\u003esend('excel_'.date(\"Y-m-d__H:i:s\").'.xls');\n```\n\n\n# Performance\n\n**Platform:**  \nIntel(R) Core(TM) i5-4670 CPU @ 3.40GHz  \nPHP 7.4    \n\n**Test case:**  \nWrite xls (BIFF8 format, UTF-8), by 5 cells (1x number, 4x string without format/styles, average line length = 120 char) in each row  \n\n**Estimated performance:**  \n\n| Number of rows | Time (seconds) | Peak memory usage (MB) |\n| --- | --- | --- |\n| 10000 | 0.2 | 4 |\n| 20000 | 0.4 | 4 |\n| 30000 | 0.6 | 6 |\n| 40000 | 0.8 | 6 |\n| 50000 | 1.0 | 8 |\n| 65534 | 1.2 | 8 |\n\n# Alternative solutions\n\n- [PHPOffice/PhpSpreadsheet](https://github.com/PHPOffice/PhpSpreadsheet)  \nFile formats supported: https://phpspreadsheet.readthedocs.io/en/latest/  \n- [box/spout](https://github.com/box/spout)  \nFile formats supported: https://opensource.box.com/spout/  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpear%2Fspreadsheet_excel_writer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpear%2Fspreadsheet_excel_writer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpear%2Fspreadsheet_excel_writer/lists"}