0
以下是從瀏覽器複製的服務器的xml響應 -使用PHP處理XML
此XML文件似乎沒有任何與其關聯的樣式信息。文檔樹如下所示。
<string><NewDataSet>
<Account>
<CustCode>UZ6CMAIN</CustCode>
<GUID>a01def6c-9d79-4deb-a93c-bebc8c7fbc1b</GUID>
<Features>0</Features>
<BaseCCY>USD</BaseCCY>
<LastOrderSEQ>160928459</LastOrderSEQ>
<LastDealSEQ>160928461</LastDealSEQ>
<OrderLotSize>100000</OrderLotSize>
<MaxOrderPips>1000</MaxOrderPips>
<CancelOrderPips>1</CancelOrderPips>
<TradeLotSize>100000</TradeLotSize>
<MaxTradeLots>25</MaxTradeLots>
<TierCount>1</TierCount>
<Tier1MinLots>1</Tier1MinLots>
<Tier1MaxLots>50</Tier1MaxLots>
<Tier1PipDifference>0</Tier1PipDifference>
<Tier2MinLots>0</Tier2MinLots>
<Tier2MaxLots>0</Tier2MaxLots>
<Tier2PipDifference>0</Tier2PipDifference>
<Tier3MinLots>0</Tier3MinLots>
<Tier3MaxLots>0</Tier3MaxLots>
<Tier3PipDifference>0</Tier3PipDifference>
</Account>
</NewDataSet></string>
使用simplexml_load_string
沒有幫助我。我試過
print ((String) $xml->Account->GUID);
但沒有打印幫助。使用XPath也沒有給出任何輸出。任何幫助,所以我可以加入帳戶標籤內的個人價值?
我用
$xml = simplexml_load_string($result);
print ((String) $xml->Account->GUID);
沒有打印任何東西。
你說 '使用simplexml_load_string沒有幫助我。'你能否告訴我們當你嘗試時發生了什麼? –
在嘗試訪問子項之前,您是否忘記訪問和元素? –
jmort253
[用php解析xml]可能的重複(http://stackoverflow.com/questions/4721120/parse-xml-with-php) –