Just trying to figure out a shorter way to do this:
I am using simpleXMLElement to parse the xml file, and this makes the need to call two lines to process the array when I know what node I want.
Current code:
$xml = new SimpleXMLElement($data);
$r = $xml->xpath('///givexNumber');
$result["cardNum"] = $r[0];
What I would like to do would be something like DomX
$result["cardNum"] = $xml->xpath('///givexNumber')->item(0)->nodeValue;
source
share