Jump to content

[SOLVED] Help with simplexml_load_string


djones

Recommended Posts

Trying to parse some XML using simplexml_load_string. When I do a var_dump of the XML I get

 

object(SimpleXMLElement)#3 (2) {
  ["AuthResponse"]=>
  object(SimpleXMLElement)#4 ( {
    ["ReturnCode"]=>
    string(2) "40"
    ["Status"]=>
    string(1) "F"
    ["ActualStatus"]=>
    object(SimpleXMLElement)#6 (0) {
    }
    ["AuthMsg"]=>
    string(57) "The Quantity field must be greater than 0 - Line item = 1"
    ["AuthCode"]=>
    object(SimpleXMLElement)#7 (0) {
    }
    ["CCType"]=>
    string(4) "VISA"
    ["AVS"]=>
    object(SimpleXMLElement)#8 (0) {
    }
    ["PCode"]=>
    object(SimpleXMLElement)#9 (0) {
    }
  }
  ["SubmittedData"]=>
  object(SimpleXMLElement)#5 (7) {
    ["TranNum"]=>
    string(7) "1008854"
    ["TotalAmt"]=>
    string(4) "7070"
    ["DbCr"]=>
    string(1) "D"
    ["AuthType"]=>
    string(1) "A"
    ["OrigTran"]=>
    object(SimpleXMLElement)#10 (0) {
    }
    ["U1"]=>
    object(SimpleXMLElement)#11 (0) {
    }
    ["U2"]=>
    object(SimpleXMLElement)#12 (0) {
    }
  }
}

 

Using this is not returning anything.

 

$return_code = $xml->authresponse->returncode; 

 

Link to comment
https://forums.phpfreaks.com/topic/155970-solved-help-with-simplexml_load_string/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.