gdbnet / fattura-elettronica-php
PHP class for italian electronic invoice xml
1.0.4
2019-07-09 09:42 UTC
Requires
- php: >=7.1
- ext-dom: *
- ext-json: *
- ext-libxml: *
- ext-xsl: *
- dompdf/dompdf: ~0.8.0
- symfony/serializer: ^2.8.50
Requires (Dev)
- phpunit/phpunit: ^7
This package is not auto-updated.
Last update: 2025-03-26 14:09:02 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