MNB PHPExcelDeveloper Guide

ODS · Structured output

ODS structured output 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.0Reference1 examples · 1 methods
ODS individual library

Structured output 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.

1
examples
1
documented methods
Example 01

Return structured ODS sheet data

Open related guide
toStructuredSheetArray()
return-structured-ods-sheet-data.php
<?php

declare(strict_types=1);

/*
Summary:
    Return selected-sheet rows together with counts, warnings, and source metadata.

Implementation note:
    Structured output is useful for APIs and previews that must explain returned, skipped, and empty
    row counts.
*/

use Mnb\PHPExcel\Format\Ods;

$payload = Ods::read(__DIR__ . '/inventory.ods')
    ->sheet('Inventory')
    ->withHeaderRow(1)
    ->toStructuredSheetArray([
        'preserve_original_row_numbers' => true,
    ]);

print_r($payload['summary']);