当我将var_dump改为$ xml
时,我得到了这个结果`object(SimpleXMLElement)[257]
public '@attributes' =>
array (size=1)
'seq' => string '290' (length=3)
public 'FIN' =>
object(SimpleXMLElement)[256]
public '@attributes' =>
array (size=1)
'seq' => string '261' (length=3)
public 'VAL' => string '1' (length=1)
public 'ATT' =>
array (size=11)
0 =>
object(SimpleXMLElement)[255]`
我需要选择simplexml,其seq值为29
提前致谢
答案 0 :(得分:0)
你可以使用xpath来查找属性'seq'等于29的元素。Suppouse,$ xml包含simplexml对象然后
$element = $xml->xpath('//*[@seq=29]');