我試圖檢查從外部返回的某些XML字段。 XML是在一個變量調用$out
返回,當您查看頁面的源代碼將得到以下的XML輸出,使用PHP讀取XML
<?xml version="1.0" encoding="UTF-8"?>
<ResponseBlock Live="FALSE" Version="3.51">
<Response Type="AUTH">
<OperationResponse>
<TransactionReference>23-9-1334895</TransactionReference>
<TransactionCompletedTimestamp>2010-04-30 15:59:05</TransactionCompletedTimestamp>
<AuthCode>AUTH CODE:TEST</AuthCode>
<TransactionVerifier>AlaUOS1MOnN/iwc5s2WPDm5ggrCLwesUnHs9h+W0N3CRaln2W6lh+6dtaRFFhLdwfnw6y7lRemyJUYl9a3dpWfzORE6DaZkFMb+dIb0Ne1UxjFEJkrEtjzx/i8KSayrIBrT/yGZOoOT42EZ9loc+UkdGk/pqYvj8bZztvgBNo2Ak=</TransactionVerifier>
<Result>1</Result>
<SettleStatus>0</SettleStatus>
<SecurityResponseSecurityCode>1</SecurityResponseSecurityCode>
<SecurityResponsePostCode>1</SecurityResponsePostCode>
<SecurityResponseAddress>1</SecurityResponseAddress>
</OperationResponse>
<Order>
<OrderInformation>This is a test order</OrderInformation>
<OrderReference>Order0001</OrderReference>
</Order>
</Response>
</ResponseBlock>
我要檢查什麼值在「結果」字段中。我不確定如何訪問使用PHP的信息,到目前爲止,我,
$xml = simplexml_load_string($out);
非常感謝