djones Posted April 28, 2009 Share Posted April 28, 2009 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 More sharing options...
RichardRotterdam Posted April 28, 2009 Share Posted April 28, 2009 The object returned is Case sensitive. or is that an array. Can you show the xml? Link to comment https://forums.phpfreaks.com/topic/155970-solved-help-with-simplexml_load_string/#findComment-821034 Share on other sites More sharing options...
djones Posted April 28, 2009 Author Share Posted April 28, 2009 *Face palm* I'm an idiot.... case sensitive. Link to comment https://forums.phpfreaks.com/topic/155970-solved-help-with-simplexml_load_string/#findComment-821037 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.