I'm guessing the NameSpaces are causing simplexml_load_string
to not work, but I'm definitely not sure.
log.xml
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sns="http://soap.com/pbx">
<env:Body>
<sns:CDR>
<PrimaryCallID>02v7b7c16v@12.123.123.12</PrimaryCallID>
<CallID>d352f920@pbx</CallID>
<From>"SMITH JOHN " <sip:11234567890@sub.domain.com:5060;user=phone></From>
<To><sip:3216549870@111.111.111.111:5060;user=phone></To>
<Direction>O</Direction>
<Type>attendant</Type>
<RemoteParty />
<LocalParty />
<TrunkName />
... more xml...
</sns:CDR>
</env:Body>
</env:Envelope>
parse.php
<?php
$string = "log.xml";
$xml = simplexml_load_string($string);
print_r($xml);
?>
I'm getting nothing back from the print_r
What am I missing?