Xml string to array, or to get his attributes

jetson

New Member
I have the following string:\[code\]<?xml version="1.0" encoding="utf-8"?><string xmlns="http://tempuri.org/UKash/Service1"><UKashTransaction><txCode>99</txCode><txDescription>Failed</txDescription><settleAmount> <settleAmount><transactionId>1341481253EDFC871620</transactionId><changeIssueVoucherNumber> <changeIssueVoucherNumber><changeIssueVoucherCurr> <changeIssueVoucherCurr><changeIssueAmount> <changeIssueAmount><changeIssueExpiryDate> <changeIssueExpiryDate><ukashTransactionId> <ukashTransactionId><currencyConversion> <currencyConversion><errCode>219</errCode><errDescription>Invalid Voucher Number</errDescription> <UKashTransaction></string></xml>\[/code\]And I want to get some attributes of that string, like txDescrition, and so on, I tried different variations but can't get result. I am using php, if anyone can help I will really appreciate it since I am blocked.UPDATE:Problem is that I do not format string to be valid so I use curl and this is what I am getting from the gateway:\[code\]<?xml version="1.0" encoding="utf-8"?><string xmlns="http://tempuri.org/UKash/Service1"><UKashTransaction><txCode>99</txCode><txDescription>Failed</txDescription><settleAmount></settleAmount><transactionId>13414821393ED286BF2A</transactionId><changeIssueVoucherNumber></changeIssueVoucherNumber><changeIssueVoucherCurr></changeIssueVoucherCurr><changeIssueAmount></changeIssueAmount><changeIssueExpiryDate></changeIssueExpiryDate><ukashTransactionId></ukashTransactionId><currencyConversion></currencyConversion><errCode>219</errCode><errDescription>Invalid Voucher Number</errDescription></UKashTransaction></string>\[/code\]Tnx.
 
Back
Top