Just trying to figure a shorter way to do this:
I'm using simpleXMLElement to parse an xml file and it's aggravating to have to call two lines to process an 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 I can do with DomX
$result["cardNum"] = $xml->xpath('///givexNumber')->item(0)->nodeValue;
Any ideas?
I didn't really see that simplexmlelement can do this, but thought someone might know a trick or two.