natilosir/excel

A PHP library to work with Excel files using PhpSpreadsheet.

1.0.0 2024-12-18 20:30 UTC

This package is auto-updated.

Last update: 2025-06-21 00:16:13 UTC


README

A simple PHP utility for working with Excel files using PhpSpreadsheet.

use Natilosir\Excel\Excel;

Example 1: Create Excel file from array

$data = [
    ["Name", "Age", "Salary"],
    ["John Doe", 28, 5000],
    ["Jane Smith", 34, 7000],
    ["Mark Taylor", 45, 9000],
];
Excel::ToExcel($data, "example.xlsx");

Example 2: Convert Excel file to array

    $arrayFromExcel = Excel::ToArray("example.xlsx");
    print_r($arrayFromExcel);