MNB PHPExcelDeveloper Guide

XML · Basic

XML basic 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-xml:^2.0Reference1 examples · 1 methods
XML individual library

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

Every snippet uses mnb/mnb-phpexcel-xml 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

Write configurable XML rows

Open related guide
Xml::write()
write-configurable-xml-rows.php
<?php

declare(strict_types=1);

/*
Summary:
    Write associative rows with application-specific root and row element names.

Implementation note:
    The XML writer targets row and workbook data contracts; it is not a general document-preserving
    DOM editor.
*/

use Mnb\PHPExcel\Format\Xml;

Xml::write($customers, __DIR__ . '/customers.xml', [
    'root' => 'customers',
    'row_tag' => 'customer',
    'pretty' => true,
]);