gdbnet/fattura-elettronica-php

PHP class for italian electronic invoice xml

Installs: 31

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 1

pkg:composer/gdbnet/fattura-elettronica-php

1.0.4 2019-07-09 09:42 UTC

This package is not auto-updated.

Last update: 2025-10-22 16:41:37 UTC


README

A PHP package to read and write the xml of italian electronic invoice.

composer require gdbnet/fattura-elettronica-php

Usage

Write the xml:

$fattura = new FatturaElettronica($header, $body);
$writer = new FatturaElettronicaXmlWriter($fattura);
$xml = $writer->encodeXml();

Read the xml:

$xml = '<?xml...';
$reader = new FatturaElettronicaXmlReader();
$fattura = $reader->decodeXml($xml);

Validate the xml using the xsd:

$xml = '<?xml...';
$validator = new XmlValidator();
if ($validator->validate($xml)) {
    echo 'valid xml';
} else {
    var_dump($validator->getErrors());
}

Credits

Forked from manrix/fattura-elettronica-php