MNB PHPExcelDeveloper Guide

ODS · Reading

ODS reading examples.

Package-local, copy-ready examples organized like the classes and methods reference. Open one example at a time, search by method, and jump from the right-side index.

Packagemnb/mnb-phpexcel-ods:^2.0Reference2 examples · 8 methods
ODS individual library

Reading examples with copy-ready, production-minded PHP.

Every snippet uses mnb/mnb-phpexcel-ods or its declared Core dependency. Each copied snippet includes strict typing, a concise summary, implementation guidance, readable limits, and a safe fixture check.

2
examples
8
documented methods
Example 01

Read ODS rows with headers

Open related guide
Ods::read()sheet()withHeaderRow()streaming()rows()
read-ods-rows-with-headers.php
<?php

declare(strict_types=1);

/*
Summary:
    Select a named ODS table and stream it as associative rows.

Implementation note:
    The standalone ODS package is reader-only. Choose a supported writer package when the workflow
    also needs output generation.
*/

use Mnb\PHPExcel\Format\Ods;

$rows = Ods::read(__DIR__ . '/inventory.ods')
    ->sheet('Inventory')
    ->withHeaderRow(1)
    ->streaming()
    ->rows();

foreach ($rows as $row) {
    echo $row['SKU'] . PHP_EOL;
}