# Welcome to PhpSpreadsheet's documentation

![Logo](./assets/logo.svg)

PhpSpreadsheet is a library written in pure PHP and providing a set of
classes that allow you to read from and to write to different
spreadsheet file formats, like Excel and LibreOffice Calc.

# Getting started

## Software requirements

The following software is required to develop using PhpSpreadsheet:

-   PHP version 5.6 or newer
-   PHP extension php\_zip enabled
-   PHP extension php\_xml enabled
-   PHP extension php\_gd2 enabled (if not compiled in)

**Note:** PHP 5.6.29 has [a bug](https://bugs.php.net/bug.php?id=73530) that
prevents SQLite3 caching to work correctly. Use a newer (or older) versions of
PHP if you need SQLite3 caching.

## Installation

Use [composer](https://getcomposer.org/) to install PhpSpreadsheet into your project:

```sh
composer require phpoffice/phpspreadsheet
```

**Note:** If you want the unreleased, unstable development version use
`phpoffice/phpspreadsheet:dev-develop` instead.

## Hello World

This would be the simplest way to write a spreadsheet:

```php
<?php

require 'vendor/autoload.php';

use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;

$spreadsheet = new Spreadsheet();
$sheet = $spreadsheet->getActiveSheet();
$sheet->setCellValue('A1', 'Hello World !');

$writer = new Xlsx($spreadsheet);
$writer->save('hello world.xlsx');
```

## Learn by example

A good way to get started is to run some of the samples. Serve the samples via
PHP built-in webserver:

```sh
php -S localhost:8000 -t vendor/phpoffice/phpspreadsheet/samples
```

Then point your browser to:

> http://localhost:8000/

The samples may also be run directly from the command line, for example:

```sh
php vendor/phpoffice/phpspreadsheet/samples/01_Simple.php
```

## Learn by documentation

For more in-depth documentation, you may read about an [overview of the
architecture](./topics/architecture.md),
[creating a spreadsheet](./topics/creating-spreadsheet.md),
[worksheets](./topics/worksheets.md),
[accessing cells](./topics/accessing-cells.md) and
[reading and writing to files](./topics/reading-and-writing-to-file.md).

# Credits

Please refer to the [contributor
list](https://github.com/PHPOffice/PhpSpreadsheet/graphs/contributors)
for up-to-date credits.
