1
嗨,我有這樣的XML響應,我分析,我可以進入第三個文本字段的值,我已經解析了它,我甚至做了中,我在屏幕上得到無法獲取XML領域
object(SimpleXMLElement)#48 (14) {
[0]=> string(4) "BB"
[1]=> string(45) " *** BEST QUOTATION ***"
[2]=> string(52) " FOR THIS ITI"
[3]=> string(48) " *** BF SEGMENTS 1P/2P ***"
...
}
但是當我嘗試直接訪問:
$XMlText=$xmlObjFourth->TerminalCommandResponse->Text;
var_dump($XMLText[2]);
它不會顯示任何東西。我甚至嘗試了foreach循環的情況下,我得到的鑰匙錯了,但還是同樣的問題
<terminal:TerminalRsp xmlns:terminal="terminal_v50_0" TransactionId="F09006B80A0759BF61F85144F306F735" ResponseTime="527">
<terminal:TerminalCommandResponse>
<terminal:Text>BB</terminal:Text>
<terminal:Text>*** BEST QUOTATION ***</terminal:Text>
<terminal:Text>FOR THIS ITI</terminal:Text>
<terminal:Text>*** BF SEGMENTS 1P/2P ***</terminal:Text>
<terminal:Text> PSGR PSG DES </terminal:Text>
<terminal:Text>FQG 1 PY2PC 3640 6201 ADT </terminal:Text>
<terminal:Text> GUARANTEED A </terminal:Text>
<terminal:Text>)><</terminal:Text>
</terminal:TerminalCommandResponse>
</terminal:TerminalRsp>