Skip to content

Instantly share code, notes, and snippets.

@juanchehin
Created October 23, 2023 12:18
Show Gist options
  • Save juanchehin/12a51570f868c4cb12f7f596e132f204 to your computer and use it in GitHub Desktop.
Save juanchehin/12a51570f868c4cb12f7f596e132f204 to your computer and use it in GitHub Desktop.
$xml = <<<EOD
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ar="http://ar.gov.afip.dif.FEV1/">
<soapenv:Header/>
<soapenv:Body>
<ar:FECompUltimoAutorizado>
<ar:Auth>
<ar:Token>string</ar:Token>
<ar:Sign>string</ar:Sign>
<ar:Cuit>long</ar:Cuit>
</ar:Auth>
<ar:PtoVta>int</ar:PtoVta>
<ar:CbteTipo>int</ar:CbteTipo>
</ar:FECompUltimoAutorizado>
</soapenv:Body>
</soapenv:Envelope>
EOD;
$dom = new DOMDocument();
$dom->loadXML($xml);
$ptoVta = $dom->getElementsByTagName('ar:PtoVta')[0];
$ptoVta->textContent = '10';
$xml = $dom->saveXML();
echo $xml;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment