1. Go to this page and download the library: Download robertogallea/php-fatturapa library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
robertogallea / php-fatturapa example snippets
/*
* Read from XML
*/
$filename = 'IT01234567890_FPA01.xml';
$fattura = FatturaPA::readFromXML($filename);
/*
* Read from XML signed document
*/
$filename = 'IT01879020517_e4duu.xml.p7m';
$fattura = FatturaPA::readFromSignedXML($filename);
/*
* Read from XML string
*/
$xml = '<your-xml-string>';
$fattura = FatturaPA::readFromXMLString($xml);
/*
* Read from XML
*/
$filename = 'IT01234567890_FPA01.xml';
FatturaPA::writeToXML($fattura, $filename);
/*
* Write to XML string
*/
$xml = FatturaPA::writeToXMLString($fattura);