On Thu, Feb 25, 2010 at 4:10 PM, Wade Preston Shearer
<[email protected]> wrote:
> I am working with GoEmerchant's XML Gateway. The responses are returned as
> XML. A simple way to convert this into usable information is using
> simplexml_load_string() (part of the SimpleXML extension). This isn't working
> for me however since it returns each node with a numbered index and since
> GoEmerchant's responses are different depending on the type of transaction
> and whether it is successful or not, I cannot address the nodes by their
> order (or index) or might grab the wrong one.
SimpleXML provides an XPath interface that you can use to search for
the node containing the status.
$xml = simplexml_load_string($string);
$array = $xml->xpath("//fie...@key='status']");
$status = $array[0];
or something like that.
--lonnie
_______________________________________________
UPHPU mailing list
[email protected]
http://uphpu.org/mailman/listinfo/uphpu
IRC: #uphpu on irc.freenode.net