PHP code example of jansenfelipe / nfephp-serialize
1. Go to this page and download the library: Download jansenfelipe/nfephp-serialize 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/ */
jansenfelipe / nfephp-serialize example snippets
$nfeProc = NFePHPSerialize::xmlToObject(file_get_contents('nfe.xml'));
//Capturando CNPJ do emitente
$cnpjEmitente = $nfeProc->getNFe()->getInfNFe()->getEmit()->getCNPJ();
//Capturando endereço do destinatário
$endereco = $nfeProc->getNFe()->getInfNFe()->getDest()->getEnderDest();
$xml = NFePHPSerialize::objectToXml(new NfeProc());